diff --git a/module_usb_midi/src/usb_midi.xc b/module_usb_midi/src/usb_midi.xc index 1c6292d5..9b1d8afe 100644 --- a/module_usb_midi/src/usb_midi.xc +++ b/module_usb_midi/src/usb_midi.xc @@ -6,6 +6,9 @@ #include //#define MIDI_LOOPBACK 1 +#ifndef MIDI_SHIFT +#define MIDI_SHIFT 0 +#endif static unsigned makeSymbol(unsigned data) { // Start and stop bits to the data packet @@ -102,7 +105,7 @@ void usb_midi(in port ?p_midi_in, out port ?p_midi_out, t2 :> rxT; #ifndef MIDI_LOOPBACK - p_midi_out <: 1; // Start with high bit. + p_midi_out <: 1< time; time += bit_time; @@ -218,7 +221,7 @@ void usb_midi(in port ?p_midi_in, out port ?p_midi_out, { time += bit_time; txPT += bit_time; - p_midi_out @ txPT <: (symbol & 1); + p_midi_out @ txPT <: ((symbol & 1)<>= 1; } @@ -305,7 +308,7 @@ void usb_midi(in port ?p_midi_in, out port ?p_midi_out, #ifdef MIDI_LOOPBACK handle_byte_from_uart(c_midi, mips, cable_number, got_next_event, next_event, waiting_for_ack, symbol); #else - p_midi_out <: 1 @ txPT; + p_midi_out <: (1< time; time += bit_time; txPT += bit_time;