From af78a2be4a575dcf96aea91357431db78f8837d0 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Mon, 13 Sep 2021 13:24:40 +0530 Subject: [PATCH] NimBLE: Modified timer not started / running warning print Existing debug prints can misled user that a crash has happened. Updated the warning print of timer validity. --- porting/npl/freertos/src/npl_os_freertos.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/porting/npl/freertos/src/npl_os_freertos.c b/porting/npl/freertos/src/npl_os_freertos.c index 9b33e5434..270226e0d 100644 --- a/porting/npl/freertos/src/npl_os_freertos.c +++ b/porting/npl/freertos/src/npl_os_freertos.c @@ -22,9 +22,12 @@ #include #include "nimble/nimble_npl.h" #include "freertos/portable.h" +#include "esp_log.h" portMUX_TYPE ble_port_mutex = portMUX_INITIALIZER_UNLOCKED; +static const char *TAG = "Timer"; + static inline bool in_isr(void) { @@ -367,8 +370,11 @@ void npl_freertos_callout_deinit(struct ble_npl_callout *co) { #if CONFIG_BT_NIMBLE_USE_ESP_TIMER - ESP_ERROR_CHECK_WITHOUT_ABORT(esp_timer_stop(co->handle)); - ESP_ERROR_CHECK_WITHOUT_ABORT(esp_timer_delete(co->handle)); + if(esp_timer_stop(co->handle)) + ESP_LOGW(TAG, "Timer not stopped"); + + if(esp_timer_delete(co->handle)) + ESP_LOGW(TAG, "Timer not deleted"); #else if (co->handle) { xTimerDelete(co->handle, portMAX_DELAY);