diff options
| author | Ha Thach <[email protected]> | 2020-07-19 13:24:57 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-07-19 13:24:57 +0700 |
| commit | 798fad397a15e28eb536bd2334e24a5b862d329a (patch) | |
| tree | 03ede455e8057a8c9a81bbda3a07eea3eaca7ff4 /src/device | |
| parent | 2274740e48a73e1888657ed6d505db19a6c252e1 (diff) | |
| parent | 8e1290e51e9d036959930dd6ea89a6ef8b517ac0 (diff) | |
Merge pull request #464 from hathach/improve-highspeed
Better support highspeed mode
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/usbd.c | 5 | ||||
| -rw-r--r-- | src/device/usbd.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index b607f5939..f59b19427 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -294,6 +294,11 @@ void usbd_driver_print_control_complete_name(bool (*control_complete) (uint8_t, //--------------------------------------------------------------------+ // Application API //--------------------------------------------------------------------+ +tusb_speed_t tud_speed_get(void) +{ + return (tusb_speed_t) _usbd_dev.speed; +} + bool tud_mounted(void) { return _usbd_dev.configured; diff --git a/src/device/usbd.h b/src/device/usbd.h index e9b82747a..d9facf719 100644 --- a/src/device/usbd.h +++ b/src/device/usbd.h @@ -53,6 +53,9 @@ bool tud_task_event_ready(void); // Interrupt handler, name alias to DCD #define tud_int_handler dcd_int_handler +// Get current bus speed +tusb_speed_t tud_speed_get(void); + // Check if device is connected and configured bool tud_mounted(void); |
