forked from PAWPAW-Mirror/lib_xua
MIDI Rx port now buffered. Means that Start-bit detect select case doesn't get started on receipt of large MIDI packet.
This commit is contained in:
@@ -117,7 +117,7 @@ on tile[AUDIO_IO_TILE] : buffered out port:32 p_spdif_tx = PORT_SPDIF_OUT;
|
|||||||
|
|
||||||
#ifdef MIDI
|
#ifdef MIDI
|
||||||
on tile[AUDIO_IO_TILE] : port p_midi_tx = PORT_MIDI_OUT;
|
on tile[AUDIO_IO_TILE] : port p_midi_tx = PORT_MIDI_OUT;
|
||||||
on tile[AUDIO_IO_TILE] : port p_midi_rx = PORT_MIDI_IN;
|
on tile[AUDIO_IO_TILE] : buffered port:1 p_midi_rx = PORT_MIDI_IN;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Clock blocks */
|
/* Clock blocks */
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* \param cable_number the cable number of the MIDI implementation.
|
* \param cable_number the cable number of the MIDI implementation.
|
||||||
* This should be set to 0.
|
* This should be set to 0.
|
||||||
**/
|
**/
|
||||||
void usb_midi(port ?p_midi_in, port ?p_midi_out,
|
void usb_midi(buffered in port:1 ?p_midi_in, port ?p_midi_out,
|
||||||
clock ?clk_midi,
|
clock ?clk_midi,
|
||||||
chanend ?c_midi,
|
chanend ?c_midi,
|
||||||
unsigned cable_number,
|
unsigned cable_number,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ static unsigned makeSymbol(unsigned data)
|
|||||||
#define RATE 31250
|
#define RATE 31250
|
||||||
|
|
||||||
#ifndef MIDI_SHIFT_TX
|
#ifndef MIDI_SHIFT_TX
|
||||||
#define MIDI_SHIFT_TX 7
|
#define MIDI_SHIFT_TX 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned bit_time = XS1_TIMER_MHZ * 1000000 / (unsigned) RATE;
|
static unsigned bit_time = XS1_TIMER_MHZ * 1000000 / (unsigned) RATE;
|
||||||
@@ -51,7 +51,7 @@ timer iAPTimer;
|
|||||||
|
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
||||||
|
|
||||||
void usb_midi(port ?p_midi_in, port ?p_midi_out,
|
void usb_midi(buffered in port:1 ?p_midi_in, port ?p_midi_out,
|
||||||
clock ?clk_midi,
|
clock ?clk_midi,
|
||||||
chanend ?c_midi,
|
chanend ?c_midi,
|
||||||
unsigned cable_number,
|
unsigned cable_number,
|
||||||
@@ -169,12 +169,14 @@ void usb_midi(port ?p_midi_in, port ?p_midi_out,
|
|||||||
unsigned event = 0;
|
unsigned event = 0;
|
||||||
uin_count++;
|
uin_count++;
|
||||||
rxByte >>= 24;
|
rxByte >>= 24;
|
||||||
// if (rxByte != outputted_symbol) {
|
#if 0
|
||||||
// // Loopback check
|
// Loopback check
|
||||||
// printhexln(rxByte);
|
if ((rxByte != outputted_symbol))
|
||||||
// printhexln(outputted_symbol);
|
{
|
||||||
// }
|
printhexln(rxByte);
|
||||||
|
printhexln(outputted_symbol);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
{valid, event} = midi_in_parse(mips, cable_number, rxByte);
|
{valid, event} = midi_in_parse(mips, cable_number, rxByte);
|
||||||
if (valid && queue_is_empty(midi_to_host_fifo))
|
if (valid && queue_is_empty(midi_to_host_fifo))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user