Skip to content

Commit

Permalink
chore: Fix builtin LED defs
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Jul 18, 2023
1 parent c0fd2a7 commit d1e1540
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/AltPinSerial/AltPinSerial.ino
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
MIDI_NAMESPACE::MidiInterface<Transport> MIDI((Transport&)serialMIDI);
#endif

// Some boards don't have this set (ESP32)
#ifndef LED_BUILTIN
#define LED_BUILTIN 0
#endif

void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Expand Down
5 changes: 5 additions & 0 deletions examples/CustomBaudRate/CustomBaudRate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ struct CustomBaudRateSettings : public MIDI_NAMESPACE::DefaultSerialSettings {
MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<HardwareSerial, CustomBaudRateSettings>> MIDI((MIDI_NAMESPACE::SerialMIDI<HardwareSerial, CustomBaudRateSettings>&)serialMIDI);
#endif

// Some boards don't have this set (ESP32)
#ifndef LED_BUILTIN
#define LED_BUILTIN 0
#endif

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
MIDI.begin(MIDI_CHANNEL_OMNI);
Expand Down
5 changes: 5 additions & 0 deletions examples/ErrorCallback/ErrorCallback.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

MIDI_CREATE_DEFAULT_INSTANCE();

// Some boards don't have this set (ESP32)
#ifndef LED_BUILTIN
#define LED_BUILTIN 0
#endif

void handleError(int8_t err)
{
digitalWrite(LED_BUILTIN, (err == 0)? LOW : HIGH);
Expand Down
5 changes: 5 additions & 0 deletions examples/ReceiverActiveSensing/ReceiverActiveSensing.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include <MIDI.h>
USING_NAMESPACE_MIDI

// Some boards don't have this set (ESP32)
#ifndef LED_BUILTIN
#define LED_BUILTIN 0
#endif

struct MyMIDISettings : public MIDI_NAMESPACE::DefaultSettings
{
// When setting UseReceiverActiveSensing to true, MIDI.read() *must* be called
Expand Down

0 comments on commit d1e1540

Please sign in to comment.