fix(uavcan): use PRIu32 for bitrate readback print on NuttX 12

The UAVCAN_BITRATE code merged via #28457 prints the driver's
arbi_bitrate (uint32_t) with %u. On the NuttX 12.12 toolchain
uint32_t is unsigned long, so -Werror=format fails every SocketCAN
board (imxrt, s32k). Use PRIu32 for the uint32_t; kbps stays %u as it
is a uint16_t promoted to int.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche committed 2026-09-03 12:31:07 -07:00
1 parent 296c1e4297
commit edcb4460a1
1 file changed
+1 -1
@@ -387,7 +387,7 @@ int CanIface::setBitRate(uint32_t bitrate)
* restarted a running controller from inside the driver, which on FlexCAN
* with ECC RAM initialisation is a bus fault. Keep the configured rate.
*/
PX4_WARN("can%" PRIu32 ": UAVCAN_BITRATE %u kbit/s needs a newer NuttX, staying at %u kbit/s",
PX4_WARN("can%" PRIu32 ": UAVCAN_BITRATE %u kbit/s needs a newer NuttX, staying at %" PRIu32 " kbit/s",
_index, kbps, ifr.ifr_ifru.ifru_can_data.arbi_bitrate);
return 0;
#else