Add dep to MidiUSB for specific example & guards for non-usb boards.
This commit is contained in:
parent
29c705fbfa
commit
253e41acc6
|
|
@ -26,7 +26,7 @@ env:
|
|||
- PLATFORMIO_CI_SRC=examples/Callbacks
|
||||
- PLATFORMIO_CI_SRC=examples/DualMerger
|
||||
- PLATFORMIO_CI_SRC=examples/Input
|
||||
- PLATFORMIO_CI_SRC=examples/MidiUSB
|
||||
- PLATFORMIO_CI_SRC=examples/MidiUSB PLATFORMIO_CI_EXTRA_ARGS="--lib=external/midi-usb/src"
|
||||
- PLATFORMIO_CI_SRC=examples/RPN_NRPN
|
||||
- PLATFORMIO_CI_SRC=examples/SimpleSynth
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ script:
|
|||
# Build current example
|
||||
- |
|
||||
if [ ! "${BUILD_UNIT_TESTS}" ]; then
|
||||
platformio ci --lib="." --board=uno --board="due" --board="zero" --board="leonardo"
|
||||
platformio ci --lib="." --board=uno --board="due" --board="zero" --board="leonardo" $PLATFORMIO_CI_EXTRA_ARGS
|
||||
fi
|
||||
|
||||
after_success:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#include <MIDI.h>
|
||||
|
||||
#if defined(USBCON)
|
||||
#include <midi_UsbTransport.h>
|
||||
|
||||
static const unsigned sUsbTransportBufferSize = 16;
|
||||
|
|
@ -8,6 +10,10 @@ UsbTransport sUsbTransport;
|
|||
|
||||
MIDI_CREATE_INSTANCE(UsbTransport, sUsbTransport, MIDI);
|
||||
|
||||
#else // No USB available, fallback to Serial
|
||||
MIDI_CREATE_DEFAULT_INSTANCE();
|
||||
#endif
|
||||
|
||||
// --
|
||||
|
||||
void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
|
||||
|
|
@ -36,4 +42,4 @@ void setup() {
|
|||
|
||||
void loop() {
|
||||
MIDI.read();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue