This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit c09eda91295482b8633bc2a79edb779e1bf6c42e
Author: ouyangxiangzhen <[email protected]>
AuthorDate: Mon Nov 9 14:09:54 2026 +0800

    arch/esp32: print tick conversions at their full width
    
    div_const() and friends now evaluate to uint64_t (the ?: composite
    type with div64_const()), where master expanded to the plain
    arithmetic type of the arguments.  The wlerr() calls in the ESP BLE
    adapters logged MSEC2TICK() results with %" PRIu32 "/%lu, which became
    a format/type mismatch (CI: "format '%lu' expects argument of type
    'long unsigned int', but argument 3 has type 'uint64_t'") on esp32c3,
    esp32 and esp32s3.
    
    Log the value with %" PRIu64 " at the four wlerr() call sites
    (esp32c3-legacy included): clock_t is int64_t, so the tick domain is
    64-bit wide and the uint64_t macro result now matches the format
    exactly -- no cast, no truncation, and for values below 2^32 the
    printed output is unchanged.
    
    Assisted-By: mimo-v2.6-pro
    Signed-off-by: ouyangxiangzhen <[email protected]>
---
 arch/risc-v/src/esp32c3-legacy/esp32c3_ble_adapter.c | 2 +-
 arch/risc-v/src/esp32c3/esp_ble_adapter.c            | 2 +-
 arch/xtensa/src/esp32/esp32_ble_adapter.c            | 2 +-
 arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c        | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/risc-v/src/esp32c3-legacy/esp32c3_ble_adapter.c 
b/arch/risc-v/src/esp32c3-legacy/esp32c3_ble_adapter.c
index 70fdc13009e..4b61fc4fb12 100644
--- a/arch/risc-v/src/esp32c3-legacy/esp32c3_ble_adapter.c
+++ b/arch/risc-v/src/esp32c3-legacy/esp32c3_ble_adapter.c
@@ -932,7 +932,7 @@ static int semphr_take_wrapper(void *semphr, uint32_t 
block_time_ms)
 
   if (ret)
     {
-      wlerr("ERROR: Failed to wait sem in %lu ticks. Error=%d\n",
+      wlerr("ERROR: Failed to wait sem in %" PRIu64 " ticks. Error=%d\n",
             MSEC2TICK(block_time_ms), ret);
     }
 
diff --git a/arch/risc-v/src/esp32c3/esp_ble_adapter.c 
b/arch/risc-v/src/esp32c3/esp_ble_adapter.c
index 3b558b0b71c..bae7dc43f56 100644
--- a/arch/risc-v/src/esp32c3/esp_ble_adapter.c
+++ b/arch/risc-v/src/esp32c3/esp_ble_adapter.c
@@ -1022,7 +1022,7 @@ static int semphr_take_wrapper(void *semphr, uint32_t 
block_time_ms)
 
   if (ret)
     {
-      wlerr("ERROR: Failed to wait sem in %" PRIu32 " ticks. Error=%d\n",
+      wlerr("ERROR: Failed to wait sem in %" PRIu64 " ticks. Error=%d\n",
             MSEC2TICK(block_time_ms), ret);
     }
 
diff --git a/arch/xtensa/src/esp32/esp32_ble_adapter.c 
b/arch/xtensa/src/esp32/esp32_ble_adapter.c
index 6b380d11529..43e1e547515 100644
--- a/arch/xtensa/src/esp32/esp32_ble_adapter.c
+++ b/arch/xtensa/src/esp32/esp32_ble_adapter.c
@@ -1121,7 +1121,7 @@ static int32_t semphr_take_wrapper(void *semphr, uint32_t 
block_time_ms)
 
   if (ret)
     {
-      wlerr("ERROR: Failed to wait sem in %" PRIu32 " ticks. Error=%d\n",
+      wlerr("ERROR: Failed to wait sem in %" PRIu64 " ticks. Error=%d\n",
             MSEC2TICK(block_time_ms), ret);
     }
 
diff --git a/arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c 
b/arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c
index c21bb2581c2..7f1cad358a0 100644
--- a/arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c
+++ b/arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c
@@ -1000,7 +1000,7 @@ static int semphr_take_wrapper(void *semphr, uint32_t 
block_time_ms)
 
   if (ret)
     {
-      wlerr("ERROR: Failed to wait sem in %" PRIu32 " ticks. Error=%d\n",
+      wlerr("ERROR: Failed to wait sem in %" PRIu64 " ticks. Error=%d\n",
             MSEC2TICK(block_time_ms), ret);
     }
 

Reply via email to