mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-11-15 05:48:06 +02:00
m1/patches/rtems/: added Milkymist-specific USB-MIDI forwarding
This commit is contained in:
parent
49bd8fd8f5
commit
a946aac7ba
47
m1/patches/rtems/milkymist-usb-midi.patch
Normal file
47
m1/patches/rtems/milkymist-usb-midi.patch
Normal file
@ -0,0 +1,47 @@
|
||||
Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_usbinput/comloc.h
|
||||
===================================================================
|
||||
--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_usbinput/comloc.h 2011-11-30 05:40:59.000000000 -0300
|
||||
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_usbinput/comloc.h 2011-11-30 05:41:26.000000000 -0300
|
||||
@@ -22,5 +22,7 @@
|
||||
#define COMLOC_MEVT(offset) COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1102+offset)
|
||||
#define COMLOC_KEVT_PRODUCE COMLOCV(MM_SOFTUSB_DMEM_BASE+0x1142)
|
||||
#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_ */
|
||||
Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_usbinput/usbinput.c
|
||||
===================================================================
|
||||
--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_usbinput/usbinput.c 2011-11-30 05:38:19.000000000 -0300
|
||||
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_usbinput/usbinput.c 2011-11-30 05:40:54.000000000 -0300
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
static int mouse_consume;
|
||||
static int keyboard_consume;
|
||||
+static int midi_consume;
|
||||
|
||||
static rtems_id event_q;
|
||||
|
||||
@@ -58,6 +59,14 @@
|
||||
rtems_message_queue_send(event_q, msg, 8);
|
||||
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(
|
||||
@@ -87,6 +96,7 @@
|
||||
|
||||
mouse_consume = 0;
|
||||
keyboard_consume = 0;
|
||||
+ midi_consume = 0;
|
||||
|
||||
sc = rtems_io_register_name(DEVICE_NAME, major, 0);
|
||||
RTEMS_CHECK_SC(sc, "create USB input device");
|
@ -14,3 +14,4 @@
|
||||
# milkymist-map-sysfreq.patch - applied 2011-11-27
|
||||
# milkymist-videoformat.patch - applied 2011-11-27
|
||||
#fix-timer-includes.patch
|
||||
milkymist-usb-midi.patch
|
||||
|
Loading…
Reference in New Issue
Block a user