Skip to content

Commit dcdeeef

Browse files
committed
fix(usb/hcd): Use PRIu32 in FIFO config log for portability
The ESP_LOGD message that prints FIFO line sizes used %u for uint32_t, which may cause incorrect output on some architectures (e.g., ESP32-P4 where uint32_t maps to unsigned long). To ensure portable and correct logging across all supported platforms, this patch replaces %u with %" PRIu32 ", defined in <inttypes.h>. No functional behavior is affected — this is a formatting correction for debug output only.
1 parent 925b563 commit dcdeeef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/usb/hcd_dwc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ esp_err_t hcd_port_init(int port_number, const hcd_port_config_t *port_config, h
14211421
esp_intr_enable(port_obj->isr_hdl);
14221422
*port_hdl = (hcd_port_handle_t)port_obj;
14231423
HCD_EXIT_CRITICAL();
1424-
ESP_LOGD(HCD_DWC_TAG, "FIFO config lines: RX=%u, PTX=%u, NPTX=%u",
1424+
ESP_LOGD(HCD_DWC_TAG, "FIFO config lines: RX=%" PRIu32 ", PTX=%" PRIu32 ", NPTX=%" PRIu32,
14251425
port_obj->fifo_config.rx_fifo_lines,
14261426
port_obj->fifo_config.ptx_fifo_lines,
14271427
port_obj->fifo_config.nptx_fifo_lines);

0 commit comments

Comments
 (0)