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() { void ArduinoLowPowerClass::sleep() {
bool restoreUSBDevice = false; bool restoreUSBDevice = false;
if (SerialUSB) { if (SERIAL_PORT_USBVIRTUAL) {
USBDevice.standby(); USBDevice.standby();
} else { } else {
USBDevice.detach(); USBDevice.detach();