esp_timer: Adds IRAM_ATTR for esp_timer_restart and esp_timer_is_active

Closes https://github.com/espressif/esp-idf/issues/10522
Closes https://github.com/espressif/esp-idf/issues/10859
pull/11519/head
KonstantinKondrashov 2023-03-01 19:54:38 +08:00
rodzic 420ebd208a
commit 024e201097
2 zmienionych plików z 11 dodań i 6 usunięć

Wyświetl plik

@ -46,10 +46,6 @@ entries:
archive: libesp_timer.a
entries:
if PM_SLP_IRAM_OPT = y:
# esp_timer_restart is called from task_wdt_timer_feed, so put it
# in IRAM if task_wdt_timer_feed itself is in IRAM.
if ESP_TASK_WDT_USE_ESP_TIMER = y:
esp_timer:esp_timer_restart (noflash)
if ESP_TIMER_IMPL_TG0_LAC = y:
esp_timer_impl_lac:esp_timer_impl_lock (noflash)
esp_timer_impl_lac:esp_timer_impl_unlock (noflash)

Wyświetl plik

@ -146,7 +146,13 @@ esp_err_t esp_timer_create(const esp_timer_create_args_t* args,
return ESP_OK;
}
esp_err_t esp_timer_restart(esp_timer_handle_t timer, uint64_t timeout_us)
/*
* We have placed this function in IRAM to ensure consistency with the esp_timer API.
* esp_timer_start_once, esp_timer_start_periodic and esp_timer_stop are in IRAM.
* But actually in IDF esp_timer_restart is used only in one place, which requires keeping
* in IRAM when PM_SLP_IRAM_OPT = y and ESP_TASK_WDT USE ESP_TIMER = y.
*/
esp_err_t IRAM_ATTR esp_timer_restart(esp_timer_handle_t timer, uint64_t timeout_us)
{
esp_err_t ret = ESP_OK;
@ -728,7 +734,10 @@ esp_err_t IRAM_ATTR esp_timer_get_expiry_time(esp_timer_handle_t timer, uint64_t
return ESP_OK;
}
bool esp_timer_is_active(esp_timer_handle_t timer)
bool IRAM_ATTR esp_timer_is_active(esp_timer_handle_t timer)
{
if (timer == NULL) {
return false;
}
return timer_armed(timer);
}