diff options
| author | HiFiPhile <[email protected]> | 2025-01-29 15:14:25 +0100 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2025-01-29 15:14:25 +0100 |
| commit | d1ee2bf18fced22364537949c4a18e1c15c99b6d (patch) | |
| tree | 6623ab3ec0aeedd1b7e6bed3116da5a5bbdf258f /src/device | |
| parent | eca025f7143141fd2bc99a94619c62a6fd666f28 (diff) | |
Fix Auto speed display.
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/usbd.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index 2a6081673..8435b5c02 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -464,13 +464,30 @@ bool tud_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) { return true; // skip if already initialized } TU_ASSERT(rh_init); - - TU_LOG_USBD("USBD init on controller %u, speed = %s\r\n", rhport, - rh_init->speed == TUSB_SPEED_HIGH ? "High" : "Full"); +#if CFG_TUSB_DEBUG >= CFG_TUD_LOG_LEVEL + char const* speed_str = 0; + switch (rh_init->speed) { + case TUSB_SPEED_HIGH: + speed_str = "High"; + break; + case TUSB_SPEED_FULL: + speed_str = "Full"; + break; + case TUSB_SPEED_LOW: + speed_str = "Low"; + break; + case TUSB_SPEED_AUTO: + speed_str = "Auto"; + break; + default: + break; + } + TU_LOG_USBD("USBD init on controller %u, speed = %s\r\n", rhport, speed_str); TU_LOG_INT(CFG_TUD_LOG_LEVEL, sizeof(usbd_device_t)); TU_LOG_INT(CFG_TUD_LOG_LEVEL, sizeof(dcd_event_t)); TU_LOG_INT(CFG_TUD_LOG_LEVEL, sizeof(tu_fifo_t)); TU_LOG_INT(CFG_TUD_LOG_LEVEL, sizeof(tu_edpt_stream_t)); +#endif tu_varclr(&_usbd_dev); _usbd_queued_setup = 0; |
