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.
Fork of SX1276GenericLib by
Diff: Arduino-mbed-APIs/arduino-mbed.cpp
- Revision:
- 96:9da7e00c9d0f
- Parent:
- 93:c328629726a6
- Child:
- 97:3d5d489206aa
diff -r 36a7fc74e437 -r 9da7e00c9d0f Arduino-mbed-APIs/arduino-mbed.cpp --- a/Arduino-mbed-APIs/arduino-mbed.cpp Sun Nov 12 20:02:57 2017 +0100 +++ b/Arduino-mbed-APIs/arduino-mbed.cpp Tue Nov 14 14:52:01 2017 +0100 @@ -11,6 +11,12 @@ #include "arduino-mbed.h" #include "arduino-util.h" +#ifdef ARDUINO_SAMD_FEATHER_M0 +#define SERIALUSB Serial +#else +#define SERIALUSB SerialUSB +#endif + Stream *ser; bool SerialUSB_active; @@ -19,13 +25,13 @@ SerialUSB_active = true; if (!timeout_ms) return; - if (serial == (Stream *)&SerialUSB) { + if (serial == (Stream *)&SERIALUSB) { uint32_t start = ms_getTicker(); SerialUSB_active = true; if (waitForSerial) { - while(!SerialUSB) { + while(!SERIALUSB) { *led = 1; delay(80); *led = 0; @@ -33,7 +39,7 @@ } return; } - while(!SerialUSB) { + while(!SERIALUSB) { if (ms_getTicker() > start + timeout_ms) { SerialUSB_active = false; break; @@ -44,7 +50,7 @@ while (USB->DEVICE.CTRLA.bit.SWRST == 1); if (led) { for (int i = 0; i < 10; i++) { - // lets blink the LED to show that SerialUSB is off. + // lets blink the LED to show that Serial over USB is off. *led = 1; delay(80); *led = 0;