summaryrefslogtreecommitdiff
path: root/shared/netutils/trace.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2025-07-06 08:19:21 +0100
committerDamien George <damien@micropython.org>2025-07-25 11:00:08 +1000
commit4495610f8d5d38bf9f4b82f5568675509019758e (patch)
tree153da58ca9eac0e9b5c1d4495ecd55af0c50a385 /shared/netutils/trace.c
parent2d93909ebe050ab08abf7de63f735b1417e02084 (diff)
shared/netutils: Cast the ticks value before printing.
Before, the compiler plugin produced an error in the PYBD_SF6 build, which is a nanboxing build with 64-bit ints. I made the decision here to cast the value even though some significant bits might be lost after 49.7 days. However, the format used is "% 8d", which produces a consistent width output for small ticks values (up to about 1.1 days). I judged that it was more valuable to preserve the fixed width display than to accurately represent long time periods. Signed-off-by: Jeff Epler <jepler@gmail.com>
Diffstat (limited to 'shared/netutils/trace.c')
-rw-r--r--shared/netutils/trace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shared/netutils/trace.c b/shared/netutils/trace.c
index a6dfb42c2..24af4d5ca 100644
--- a/shared/netutils/trace.c
+++ b/shared/netutils/trace.c
@@ -56,7 +56,7 @@ static const char *ethertype_str(uint16_t type) {
}
void netutils_ethernet_trace(const mp_print_t *print, size_t len, const uint8_t *buf, unsigned int flags) {
- mp_printf(print, "[% 8d] ETH%cX len=%u", mp_hal_ticks_ms(), flags & NETUTILS_TRACE_IS_TX ? 'T' : 'R', len);
+ mp_printf(print, "[% 8u] ETH%cX len=%u", (unsigned)mp_hal_ticks_ms(), flags & NETUTILS_TRACE_IS_TX ? 'T' : 'R', len);
mp_printf(print, " dst=%02x:%02x:%02x:%02x:%02x:%02x", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
mp_printf(print, " src=%02x:%02x:%02x:%02x:%02x:%02x", buf[6], buf[7], buf[8], buf[9], buf[10], buf[11]);