forked from Imagelibrary/rtems
PR2028: Milkymist USB: forward MIDI messages.
Forward MIDI messages from the softusb controller to the application. Signed-off-by: Gedare Bloom <gedare@rtems.org>
This commit is contained in:
committed by
Gedare Bloom
parent
19d18f2350
commit
f7bb9f922d
@@ -22,5 +22,7 @@
|
|||||||
#define COMLOC_MEVT(offset) COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1102+offset)
|
#define COMLOC_MEVT(offset) COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1102+offset)
|
||||||
#define COMLOC_KEVT_PRODUCE COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1142)
|
#define COMLOC_KEVT_PRODUCE COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1142)
|
||||||
#define COMLOC_KEVT(offset) COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1143+offset)
|
#define COMLOC_KEVT(offset) COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1143+offset)
|
||||||
|
#define COMLOC_MIDI_PRODUCE COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1183)
|
||||||
|
#define COMLOC_MIDI(offset) COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1184+offset)
|
||||||
|
|
||||||
#endif /* __COMLOC_H_ */
|
#endif /* __COMLOC_H_ */
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ static const unsigned char input_firmware[] = {
|
|||||||
|
|
||||||
static int mouse_consume;
|
static int mouse_consume;
|
||||||
static int keyboard_consume;
|
static int keyboard_consume;
|
||||||
|
static int midi_consume;
|
||||||
|
|
||||||
static rtems_id event_q;
|
static rtems_id event_q;
|
||||||
|
|
||||||
@@ -58,6 +59,14 @@ static rtems_isr interrupt_handler(rtems_vector_number n)
|
|||||||
rtems_message_queue_send(event_q, msg, 8);
|
rtems_message_queue_send(event_q, msg, 8);
|
||||||
keyboard_consume = (keyboard_consume + 1) & 0x07;
|
keyboard_consume = (keyboard_consume + 1) & 0x07;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while(midi_consume != COMLOC_MIDI_PRODUCE) {
|
||||||
|
for(i=0;i<3;i++)
|
||||||
|
msg[i] = COMLOC_MIDI(4*midi_consume+i+1);
|
||||||
|
rtems_message_queue_send(event_q, msg, 3);
|
||||||
|
midi_consume = (midi_consume + 1) & 0x0f;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rtems_device_driver usbinput_initialize(
|
rtems_device_driver usbinput_initialize(
|
||||||
@@ -87,6 +96,7 @@ rtems_device_driver usbinput_initialize(
|
|||||||
|
|
||||||
mouse_consume = 0;
|
mouse_consume = 0;
|
||||||
keyboard_consume = 0;
|
keyboard_consume = 0;
|
||||||
|
midi_consume = 0;
|
||||||
|
|
||||||
sc = rtems_io_register_name(DEVICE_NAME, major, 0);
|
sc = rtems_io_register_name(DEVICE_NAME, major, 0);
|
||||||
RTEMS_CHECK_SC(sc, "create USB input device");
|
RTEMS_CHECK_SC(sc, "create USB input device");
|
||||||
|
|||||||
Reference in New Issue
Block a user