feat(gptimer): make start and stop function idempotent

Closes https://github.com/espressif/esp-idf/issues/12325
Closes https://github.com/espressif/esp-idf/issues/13486
This commit is contained in:
morris
2025-02-25 11:41:56 +08:00
parent 0ba53566fa
commit 46cc737580
7 changed files with 110 additions and 85 deletions
@@ -299,7 +299,7 @@ TEST_ALARM_CALLBACK_ATTR static bool test_gptimer_alarm_normal_callback(gptimer_
* Also should account for the inaccuracy of the systick during DFS.
*/
#if CONFIG_PM_ENABLE
#define GPTIMER_ONE_SHOT_ALARM_COUNT_DELTA 15000
#define GPTIMER_ONE_SHOT_ALARM_COUNT_DELTA 50000
#else
#define GPTIMER_ONE_SHOT_ALARM_COUNT_DELTA 1000
#endif // CONFIG_PM_ENABLE
@@ -23,7 +23,7 @@ static void IRAM_ATTR test_delay_post_cache_disable(void *args)
esp_rom_delay_us(1000);
}
TEST_CASE("gptimer_interrupt_iram_safe", "[gptimer]")
TEST_CASE("gptimer works with cache disabled", "[gptimer]")
{
gptimer_handle_t gptimer = NULL;
gptimer_config_t timer_config = {