From c8edad4ed3de2d11d4ef53822c105796feea243c Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 26 Aug 2022 10:08:31 +0800 Subject: [PATCH] sam4l: fix debug formatting SAM4L added a DEBUG_INFO command that uses insufficiently-specific formatting. This breaks compiles on ESP32. Use specific formatters. Additionally, ensure that FLASHCALW_BASE is defined as a long int, which allows it to be formatted with "%x". Signed-off-by: Sean Cross --- src/target/sam4l.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/target/sam4l.c b/src/target/sam4l.c index 254243f..9088083 100644 --- a/src/target/sam4l.c +++ b/src/target/sam4l.c @@ -32,7 +32,7 @@ /* * Flash Controller defines */ -#define FLASHCALW_BASE 0x400A0000 +#define FLASHCALW_BASE UINT32_C(0x400A0000) /* Flash Control Register */ #define FLASHCALW_FCR (FLASHCALW_BASE + 0x00) @@ -295,7 +295,8 @@ sam4l_extended_reset(target *t) static bool sam4l_flash_command(target *t, uint32_t page, uint32_t cmd) { DEBUG_INFO( - "\nSAM4L: sam4l_flash_command: FSR: 0x%08" PRIx32 ", page = %lu, command = %lu\n", FLASHCALW_FSR, page, cmd); + "\nSAM4L: sam4l_flash_command: FSR: 0x%08" PRIx32 + ", page = %" PRIu32 ", command = %" PRIu32 "\n", FLASHCALW_FSR, page, cmd); /* wait for Flash controller ready */ platform_timeout timeout;