Simple USB-MIDI foot controller
Dependencies: PinDetect USBDevice_STM32F103 mbed-STM32F103C8T6
Diff: main.cpp
- Revision:
- 6:2f804d29cbb0
- Parent:
- 5:1208f33a9a7c
- Child:
- 7:553836a26221
diff -r 1208f33a9a7c -r 2f804d29cbb0 main.cpp --- a/main.cpp Fri Aug 04 03:29:27 2017 +0200 +++ b/main.cpp Fri Aug 04 03:44:19 2017 +0200 @@ -28,6 +28,10 @@ void write_midi_msg(MIDIMessage msg) { +#ifndef NDEBUG + serial->printf("Sending MIDI message controller=%d channel=%d value=%d\r\n", + msg.controller(), msg.channel(), msg.value()); +#endif midi->write(msg); } @@ -63,11 +67,10 @@ usbThread.start(callback(&queue, &EventQueue::dispatch_forever)); for (int sw=0; sw < NUM_SWITCHES; sw++) { - handlers[sw] = new SwitchHandler(&queue, &write_midi_msg, &switches[sw]); #ifndef NDEBUG serial->printf("Initializing switch handler %d...\r\n", sw + 1); - handlers[sw]->setSerial(serial); #endif + handlers[sw] = new SwitchHandler(&queue, &write_midi_msg, &switches[sw]); } #ifndef NDEBUG