From c3c7164dc5e246d7108a878f770e42c3c1e91541 Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Fri, 30 May 2025 19:53:39 +0800 Subject: [PATCH] fix(ble): set timer handle to null after deletion (cherry picked from commit 1614e71eb64f49dc7f8579dd2da742b2dd534880) Co-authored-by: Zhou Xiao --- components/bt/common/ble_log/ble_log_spi_out.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/bt/common/ble_log/ble_log_spi_out.c b/components/bt/common/ble_log/ble_log_spi_out.c index c63e447c8f..18e2dd0169 100644 --- a/components/bt/common/ble_log/ble_log_spi_out.c +++ b/components/bt/common/ble_log/ble_log_spi_out.c @@ -718,6 +718,7 @@ static int spi_out_ts_sync_init(void) gpio_init_failed: #if !SPI_OUT_TS_SYNC_SLEEP_SUPPORT esp_timer_delete(ts_sync_timer); + ts_sync_timer = NULL; timer_init_failed: #endif // !SPI_OUT_TS_SYNC_SLEEP_SUPPORT return -1; @@ -733,6 +734,7 @@ static void spi_out_ts_sync_deinit(void) // Deinitialize timestamp synchronizer esp_timer_stop(ts_sync_timer); esp_timer_delete(ts_sync_timer); + ts_sync_timer = NULL; #endif // !SPI_OUT_TS_SYNC_SLEEP_SUPPORT // Deinitialize sync IO @@ -959,6 +961,7 @@ void ble_log_spi_out_deinit(void) #if SPI_OUT_FLUSH_TIMER_ENABLED esp_timer_stop(flush_timer); esp_timer_delete(flush_timer); + flush_timer = NULL; #endif // SPI_OUT_FLUSH_TIMER_ENABLED // Drain all queued transactions