summaryrefslogtreecommitdiff
path: root/software
diff options
context:
space:
mode:
Diffstat (limited to 'software')
-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();