summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2025-01-29 15:14:25 +0100
committerHiFiPhile <[email protected]>2025-01-29 15:14:25 +0100
commitd1ee2bf18fced22364537949c4a18e1c15c99b6d (patch)
tree6623ab3ec0aeedd1b7e6bed3116da5a5bbdf258f /src/host
parenteca025f7143141fd2bc99a94619c62a6fd666f28 (diff)
Fix Auto speed display.
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/host')
-rw-r--r--src/host/usbh.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index a2994cde7..f022d93f1 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -365,9 +365,26 @@ bool tuh_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
if (tuh_rhport_is_active(rhport)) {
return true; // skip if already initialized
}
-
- TU_LOG_USBH("USBH init on controller %u, speed = %s\r\n", rhport,
- rh_init->speed == TUSB_SPEED_HIGH ? "High" : "Full");
+#if CFG_TUSB_DEBUG >= CFG_TUH_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_USBH("USBH init on controller %u, speed = %s\r\n", rhport, speed_str);
+#endif
// Init host stack if not already
if (!tuh_inited()) {