mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-08 02:57:56 +00:00
Nimble: Fix crash when attempting to do deinit
If esp timer is created, but not started, and if we call Nimble deinit , then during deinit, the existing code checks for the timer state and returns with a status other than ESP_OK. However, existing ESP_ERROR_CHECK macro treats this as failure and causes crash. Modified the code to use ESP_ERROR_CHECK_WITHOUT_ABORT instead.
This commit is contained in:
@@ -368,8 +368,8 @@ void
|
||||
npl_freertos_callout_deinit(struct ble_npl_callout *co)
|
||||
{
|
||||
#if CONFIG_BT_NIMBLE_USE_ESP_TIMER
|
||||
ESP_ERROR_CHECK(esp_timer_stop(co->handle));
|
||||
ESP_ERROR_CHECK(esp_timer_delete(co->handle));
|
||||
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_timer_stop(co->handle));
|
||||
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_timer_delete(co->handle));
|
||||
#else
|
||||
if (co->handle) {
|
||||
xTimerDelete(co->handle, portMAX_DELAY);
|
||||
|
||||
Reference in New Issue
Block a user