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:
parent
5399b36207
commit
b38a5bc50c
@ -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();
|
||||||
@ -100,4 +100,4 @@ void ArduinoLowPowerClass::attachInterruptWakeup(uint32_t pin, voidFuncPtr callb
|
|||||||
|
|
||||||
ArduinoLowPowerClass LowPower;
|
ArduinoLowPowerClass LowPower;
|
||||||
|
|
||||||
#endif // ARDUINO_ARCH_SAMD
|
#endif // ARDUINO_ARCH_SAMD
|
||||||
|
Loading…
x
Reference in New Issue
Block a user