Przeglądaj źródła

Merge branch 'bugfix/fix_timer_deleted_and_run_broken_callback' into 'master'

esp_timer: fix the bug that when timeout of timer happens try to run callback,...

Closes WIFI-1214

See merge request espressif/esp-idf!6765
Jiang Jiang Jian 6 lat temu
rodzic
commit
0deeae38a9
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      components/esp_common/src/esp_timer.c

+ 3 - 1
components/esp_common/src/esp_timer.c

@@ -300,8 +300,10 @@ static void timer_process_alarm(esp_timer_dispatch_t dispatch_method)
 #if WITH_PROFILING
         uint64_t callback_start = now;
 #endif
+        esp_timer_cb_t callback = it->callback;
+        void* arg = it->arg;
         timer_list_unlock();
-        (*it->callback)(it->arg);
+        (*callback)(arg);
         timer_list_lock();
         now = esp_timer_impl_get_time();
 #if WITH_PROFILING