Skip to content

Commit b52f2f5

Browse files
committed
Bugfix/re-initializing stack tiggering timer assert.
1 parent f3869e7 commit b52f2f5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/nimble/porting/npl/freertos/src/npl_os_freertos.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,16 +1771,19 @@ npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq
17711771
void
17721772
npl_freertos_callout_deinit(struct ble_npl_callout *co)
17731773
{
1774+
if (!co->handle) {
1775+
return;
1776+
}
1777+
17741778
#if CONFIG_BT_NIMBLE_USE_ESP_TIMER
17751779
if(esp_timer_stop(co->handle))
17761780
ESP_LOGW(TAG, "Timer not stopped");
17771781

17781782
if(esp_timer_delete(co->handle))
17791783
ESP_LOGW(TAG, "Timer not deleted");
17801784
#else
1781-
if (co->handle) {
1782-
xTimerDelete(co->handle, portMAX_DELAY);
1783-
}
1785+
xTimerDelete(co->handle, portMAX_DELAY);
1786+
ble_npl_event_deinit(&co->ev);
17841787
#endif
17851788
memset(co, 0, sizeof(struct ble_npl_callout));
17861789
}
@@ -1824,6 +1827,9 @@ npl_freertos_callout_reset(struct ble_npl_callout *co, ble_npl_time_t ticks)
18241827
void
18251828
npl_freertos_callout_stop(struct ble_npl_callout *co)
18261829
{
1830+
if (!co->handle) {
1831+
return;
1832+
}
18271833
#if CONFIG_BT_NIMBLE_USE_ESP_TIMER
18281834
esp_timer_stop(co->handle);
18291835
#else

0 commit comments

Comments
 (0)