forked from PAWPAW-Mirror/lib_xua
Use CT_END instead of CT_PAUSE for MIDI handshake
This commit is contained in:
@@ -58,23 +58,26 @@ INLINE void midi_get_ack_or_data(chanend c, int &is_ack, unsigned int &datum) {
|
||||
if (testct(c)) {
|
||||
is_ack = 1;
|
||||
(void) inct(c); // read 1-bytes control token
|
||||
(void) inuchar(c);
|
||||
(void) inuchar(c);
|
||||
(void) inuchar(c);
|
||||
chkct(c, XS1_CT_END);
|
||||
}
|
||||
else {
|
||||
is_ack = 0;
|
||||
datum = inuint(c);
|
||||
chkct(c, XS1_CT_END);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
INLINE void midi_send_ack(chanend c) {
|
||||
outct(c, MIDI_ACK);
|
||||
outuchar(c, 0);
|
||||
outuchar(c, 0);
|
||||
outuchar(c, 0);
|
||||
outct(c, XS1_CT_END);
|
||||
}
|
||||
|
||||
INLINE void midi_send_data(chanend c, unsigned int datum) {
|
||||
outuint(c, datum);
|
||||
outct(c, XS1_CT_END);
|
||||
}
|
||||
|
||||
#define MIDI_RATE (31250)
|
||||
#define MIDI_BITTIME (XS1_TIMER_MHZ * 1000000 / MIDI_RATE)
|
||||
#define MIDI_BITTIME_2 (MIDI_BITTIME>>1)
|
||||
|
||||
Reference in New Issue
Block a user