From fc07df320bf20ed5b3d78ad181d8af1533e12c12 Mon Sep 17 00:00:00 2001 From: dp111 <19616418+dp111@users.noreply.github.com> Date: Tue, 3 Sep 2024 20:28:42 +0100 Subject: [PATCH] use fixed with in printf ( found by clang) NB %lu is a minimum of 32 bits where as the variable use is exactly 32 bits . This can affect porting to other systems. --- examples/typec/power_delivery/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/typec/power_delivery/src/main.c b/examples/typec/power_delivery/src/main.c index 489d01aa1..a8214f34e 100644 --- a/examples/typec/power_delivery/src/main.c +++ b/examples/typec/power_delivery/src/main.c @@ -98,7 +98,7 @@ bool tuc_pd_data_received_cb(uint8_t rhport, pd_header_t const* header, uint8_t pd_pdo_fixed_t const* fixed = (pd_pdo_fixed_t const*) &pdo; uint32_t const voltage_mv = fixed->voltage_50mv*50; uint32_t const current_ma = fixed->current_max_10ma*10; - printf("[Fixed] %lu mV %lu mA\r\n", voltage_mv, current_ma); + printf("[Fixed] %"PRIu32" mV %"PRIu32" mA\r\n", voltage_mv, current_ma); if (voltage_mv <= VOLTAGE_MAX_MV && current_ma >= CURRENT_MAX_MA) { // Found a suitable PDO