summaryrefslogtreecommitdiff
path: root/src/device/usbd.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-03-30 23:01:23 +0700
committerhathach <[email protected]>2019-03-30 23:01:23 +0700
commiteabfc53f38dc538b44615aed32db66484a3acca4 (patch)
treee1ad77937c1ed4b2f3d81636d4f94fe2d25647e3 /src/device/usbd.c
parentf3a954e7deaa33db5fed8e807cd146e65aaeb104 (diff)
added tud_suspended() and tud_ready()
Diffstat (limited to 'src/device/usbd.c')
-rw-r--r--src/device/usbd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index fb6249528..7b87d1944 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -182,6 +182,11 @@ bool tud_mounted(void)
return _usbd_dev.configured;
}
+bool tud_suspended(void)
+{
+ return _usbd_dev.suspended;
+}
+
bool tud_remote_wakeup(void)
{
// only wake up host if this feature is supported and enabled and we are suspended
@@ -627,6 +632,7 @@ void dcd_event_handler(dcd_event_t const * event, bool in_isr)
case DCD_EVENT_UNPLUGGED:
_usbd_dev.connected = 0;
_usbd_dev.configured = 0;
+ _usbd_dev.suspended = 0;
osal_queue_send(_usbd_q, event, in_isr);
break;