From f789215899a7ca2995b55e06f983be271eff4a00 Mon Sep 17 00:00:00 2001 From: Vincent Lu Date: Sun, 28 Jun 2026 22:30:50 -0400 Subject: [PATCH 1/3] fix infinite recursion bug for ticks to ms conversion --- src/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h b/src/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h index ef999d140..9b7ef98e6 100644 --- a/src/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h +++ b/src/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h @@ -651,7 +651,7 @@ ble_npl_time_ms_to_ticks(uint32_t ms, ble_npl_time_t *out_ticks) static inline ble_npl_error_t ble_npl_time_ticks_to_ms(ble_npl_time_t ticks, uint32_t *out_ms) { - return ble_npl_time_ticks_to_ms(ticks, out_ms); + return npl_freertos_time_ticks_to_ms(ticks, out_ms); } static inline ble_npl_time_t From af381e4e4d852829aad3c097fd842faaad9ddb8b Mon Sep 17 00:00:00 2001 From: Vincent Lu Date: Sun, 28 Jun 2026 22:58:46 -0400 Subject: [PATCH 2/3] timestamps for NimBLELog messages --- src/NimBLELog.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/NimBLELog.h b/src/NimBLELog.h index ad57a0aaa..fc40eab2b 100644 --- a/src/NimBLELog.h +++ b/src/NimBLELog.h @@ -147,27 +147,28 @@ # else # include "nimble/console/console.h" +# include "esp32-hal.h" # if MYNEWT_VAL(NIMBLE_CPP_LOG_LEVEL) >= 4 -# define NIMBLE_LOGD(tag, format, ...) console_printf("D %s: " format "\n", tag, ##__VA_ARGS__) +# define NIMBLE_LOGD(tag, format, ...) console_printf("D (%lu) %s: " format "\n", millis(), tag, ##__VA_ARGS__) # else # define NIMBLE_LOGD(tag, format, ...) (void)tag # endif # if MYNEWT_VAL(NIMBLE_CPP_LOG_LEVEL) >= 3 -# define NIMBLE_LOGI(tag, format, ...) console_printf("I %s: " format "\n", tag, ##__VA_ARGS__) +# define NIMBLE_LOGI(tag, format, ...) console_printf("I (%lu) %s: " format "\n", millis(), tag, ##__VA_ARGS__) # else # define NIMBLE_LOGI(tag, format, ...) (void)tag # endif # if MYNEWT_VAL(NIMBLE_CPP_LOG_LEVEL) >= 2 -# define NIMBLE_LOGW(tag, format, ...) console_printf("W %s: " format "\n", tag, ##__VA_ARGS__) +# define NIMBLE_LOGW(tag, format, ...) console_printf("W (%lu) %s: " format "\n", millis(), tag, ##__VA_ARGS__) # else # define NIMBLE_LOGW(tag, format, ...) (void)tag # endif # if MYNEWT_VAL(NIMBLE_CPP_LOG_LEVEL) >= 1 -# define NIMBLE_LOGE(tag, format, ...) console_printf("E %s: " format "\n", tag, ##__VA_ARGS__) +# define NIMBLE_LOGE(tag, format, ...) console_printf("E (%lu) %s: " format "\n", millis(), tag, ##__VA_ARGS__) # else # define NIMBLE_LOGE(tag, format, ...) (void)tag # endif From 505c190cd64a8e8416fa17051278543964e9029e Mon Sep 17 00:00:00 2001 From: Vincent Lu Date: Sun, 28 Jun 2026 23:06:59 -0400 Subject: [PATCH 3/3] fixed to include Arduino.h --- src/NimBLELog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NimBLELog.h b/src/NimBLELog.h index fc40eab2b..47e46678e 100644 --- a/src/NimBLELog.h +++ b/src/NimBLELog.h @@ -147,7 +147,7 @@ # else # include "nimble/console/console.h" -# include "esp32-hal.h" +# include # if MYNEWT_VAL(NIMBLE_CPP_LOG_LEVEL) >= 4 # define NIMBLE_LOGD(tag, format, ...) console_printf("D (%lu) %s: " format "\n", millis(), tag, ##__VA_ARGS__)