summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Tomaszewski <[email protected]>2021-02-22 11:24:16 +0100
committerKamil Tomaszewski <[email protected]>2021-02-22 11:24:16 +0100
commitb591a66b3d38bc199aaa5ac1b32d0a1221b8b983 (patch)
tree23b462efff1f56f3cdbb4a496cc49c025167fe3f
parentd3195414dc770adc767fcf319afd595dbf63b68d (diff)
Pass the correct speed on Spresense
-rw-r--r--src/portable/sony/cxd56/dcd_cxd56.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/portable/sony/cxd56/dcd_cxd56.c b/src/portable/sony/cxd56/dcd_cxd56.c
index 88027ccaa..904176ba1 100644
--- a/src/portable/sony/cxd56/dcd_cxd56.c
+++ b/src/portable/sony/cxd56/dcd_cxd56.c
@@ -155,7 +155,24 @@ static void _dcd_disconnect(FAR struct usbdevclass_driver_s *driver, FAR struct
{
(void) driver;
- tusb_speed_t speed = (dev->speed == 3) ? TUSB_SPEED_HIGH : TUSB_SPEED_FULL;
+ tusb_speed_t speed;
+
+ switch (dev->speed)
+ {
+ case USB_SPEED_LOW:
+ speed = TUSB_SPEED_LOW;
+ break;
+ case USB_SPEED_FULL:
+ speed = TUSB_SPEED_FULL;
+ break;
+ case USB_SPEED_HIGH:
+ speed = TUSB_SPEED_HIGH;
+ break;
+ default:
+ speed = TUSB_SPEED_HIGH;
+ break;
+ }
+
dcd_event_bus_reset(0, speed, true);
DEV_CONNECT(dev);
}