Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: PinDetect USBDevice_STM32F103 mbed-STM32F103C8T6
Diff: midiswitch.cpp
- Revision:
- 7:553836a26221
- Parent:
- 6:2f804d29cbb0
- Child:
- 8:75c5ec68765e
--- a/midiswitch.cpp Fri Aug 04 03:44:19 2017 +0200
+++ b/midiswitch.cpp Fri Aug 04 04:20:37 2017 +0200
@@ -1,7 +1,10 @@
+#include "mbed.h"
#include "midiswitch.h"
SwitchHandler::SwitchHandler(EventQueue * queue, MIDI_CB cb, SwitchConfig * sw) :
queue(queue), write_cb(cb), btn(sw->pin), control(sw->control), channel(sw->channel), on_value(sw->on_value), off_value(sw->off_value) {
+ btn.mode(Pullup);
+ btn.setAssertValue(0);
btn.attach_asserted(this, &SwitchHandler::handle_pressed);
btn.attach_deasserted(this, &SwitchHandler::handle_released);
btn.setSampleFrequency();