diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h index 479ced9c8..701a14f78 100644 --- a/cores/arduino/USBAPI.h +++ b/cores/arduino/USBAPI.h @@ -65,6 +65,8 @@ class USBDevice_ void detach(); // Serial port goes down too... void poll(); bool wakeupHost(); // returns false, when wakeup cannot be processed + + bool isSuspended(); }; extern USBDevice_ USBDevice; diff --git a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp index 81f689d24..c0a4c7cc0 100644 --- a/cores/arduino/USBCore.cpp +++ b/cores/arduino/USBCore.cpp @@ -855,4 +855,10 @@ bool USBDevice_::wakeupHost() return false; } +bool USBDevice_::isSuspended() +{ + return (_usbSuspendState & (1 << SUSPI)); +} + + #endif /* if defined(USBCON) */