summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-09-09 16:01:05 +0700
committerhathach <[email protected]>2021-09-09 16:01:05 +0700
commit27800f7e4f39c856d2fe82e6320e855d8c283518 (patch)
tree252144cf4760fa81b05105b5aca15894e1f64066 /src/device
parentf81368174b613f4168ddb0e2ec1822c8dbc31d59 (diff)
remove connected check for DCD_EVENT_UNPLUGGED since previous bus reset can clear this
implement unplugged detection for trans dimension dcd
Diffstat (limited to 'src/device')
-rw-r--r--src/device/usbd.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 58b3a5701..4ab60569b 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -1064,15 +1064,11 @@ void dcd_event_handler(dcd_event_t const * event, bool in_isr)
switch (event->event_id)
{
case DCD_EVENT_UNPLUGGED:
- // UNPLUGGED event can be bouncing, only processing if we are currently connected
- if ( _usbd_dev.connected )
- {
- _usbd_dev.connected = 0;
- _usbd_dev.addressed = 0;
- _usbd_dev.cfg_num = 0;
- _usbd_dev.suspended = 0;
- osal_queue_send(_usbd_q, event, in_isr);
- }
+ _usbd_dev.connected = 0;
+ _usbd_dev.addressed = 0;
+ _usbd_dev.cfg_num = 0;
+ _usbd_dev.suspended = 0;
+ osal_queue_send(_usbd_q, event, in_isr);
break;
case DCD_EVENT_SUSPEND: