summaryrefslogtreecommitdiff
path: root/software/rhmixxx
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2014-06-01 18:08:27 (GMT)
committerChristian Pointner <equinox@helsinki.at>2014-06-01 18:08:27 (GMT)
commita0ed05f4258971054287cac8e825f49a1bf51f80 (patch)
tree352eca5213e16d6d71c166019fe29abd862af7d5 /software/rhmixxx
parenta8025d154d51e6247147bf9322e2726106bcfe5c (diff)
receving midi events works now
Diffstat (limited to 'software/rhmixxx')
-rw-r--r--software/rhmixxx/keypad.h6
-rw-r--r--software/rhmixxx/rhmixxx.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/software/rhmixxx/keypad.h b/software/rhmixxx/keypad.h
index 14a0a08..efd8a87 100644
--- a/software/rhmixxx/keypad.h
+++ b/software/rhmixxx/keypad.h
@@ -24,9 +24,9 @@
void keypad_init(void);
-void keypad_leds_on(uint16_t leds);
-void keypad_leds_off(uint16_t leds);
-void keypad_leds_toggle(uint16_t leds);
+void keypad_led_on(uint8_t leds);
+void keypad_led_off(uint8_t leds);
+void keypad_led_toggle(uint8_t leds);
void keypad_task(void);
diff --git a/software/rhmixxx/rhmixxx.c b/software/rhmixxx/rhmixxx.c
index 07a139e..fa39f66 100644
--- a/software/rhmixxx/rhmixxx.c
+++ b/software/rhmixxx/rhmixxx.c
@@ -107,7 +107,12 @@ int main(void)
for(;;) {
MIDI_EventPacket_t ReceivedMIDIEvent;
while(MIDI_Device_ReceiveEventPacket(&MIDI_Interface, &ReceivedMIDIEvent)) {
- // TODO: process incoming MIDI Events
+ if(ReceivedMIDIEvent.Data2 < 16) { // TODO: hardcoded value
+ switch(ReceivedMIDIEvent.Data1 & 0xF0) {
+ case MIDI_COMMAND_NOTE_ON: keypad_led_on(ReceivedMIDIEvent.Data2); break;
+ case MIDI_COMMAND_NOTE_OFF: keypad_led_off(ReceivedMIDIEvent.Data2); break;
+ }
+ }
}
keypad_task();