Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6ba4fd3

Browse files
Merge pull request #54 from algernon/pull/wakeup-suspend-hooks
Add USBDevice.isSuspended()
2 parents 4efd686 + c87bc7b commit 6ba4fd3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

‎cores/arduino/USBAPI.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class USBDevice_
6565
void detach(); // Serial port goes down too...
6666
void poll();
6767
bool wakeupHost(); // returns false, when wakeup cannot be processed
68+
69+
bool isSuspended();
6870
};
6971
extern USBDevice_ USBDevice;
7072

‎cores/arduino/USBCore.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,4 +855,10 @@ bool USBDevice_::wakeupHost()
855855
return false;
856856
}
857857

858+
bool USBDevice_::isSuspended()
859+
{
860+
return (_usbSuspendState & (1 << SUSPI));
861+
}
862+
863+
858864
#endif /* if defined(USBCON) */

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /