1
0
mirror of https://github.com/arduino-libraries/ArduinoLowPower.git synced 2025-04-19 11:42:14 +03:00

Add support for boards with different name of serial USB connection (#6)

* Replace SerialUSB by SERIAL_PORT_USBVIRTUAL

Support boards where USB serial is named differently. E.g. the
Adafruit Feather M0 uses Serial1 as name for serial USB port.
This commit is contained in:
Stefan Lehmann 2018-08-20 15:43:46 +02:00 committed by Martino Facchin
parent 5399b36207
commit b38a5bc50c

View File

@ -17,7 +17,7 @@ void ArduinoLowPowerClass::idle(uint32_t millis) {
void ArduinoLowPowerClass::sleep() {
bool restoreUSBDevice = false;
if (SerialUSB) {
if (SERIAL_PORT_USBVIRTUAL) {
USBDevice.standby();
} else {
USBDevice.detach();
@ -100,4 +100,4 @@ void ArduinoLowPowerClass::attachInterruptWakeup(uint32_t pin, voidFuncPtr callb
ArduinoLowPowerClass LowPower;
#endif // ARDUINO_ARCH_SAMD
#endif // ARDUINO_ARCH_SAMD