From 874b470379c7435c63811f202ad88e344b0b4a56 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Mon, 12 Apr 2021 09:40:46 +0800 Subject: [PATCH] timer: add IRAM_ATTR to spinlock give/take API Closes https://github.com/espressif/esp-idf/issues/6824 --- components/driver/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/driver/timer.c b/components/driver/timer.c index 49dc770b10..1949777ac7 100644 --- a/components/driver/timer.c +++ b/components/driver/timer.c @@ -474,14 +474,14 @@ bool IRAM_ATTR timer_group_get_auto_reload_in_isr(timer_group_t group_num, timer return timer_hal_get_auto_reload(&(p_timer_obj[group_num][timer_num]->hal)); } -esp_err_t timer_spinlock_take(timer_group_t group_num) +esp_err_t IRAM_ATTR timer_spinlock_take(timer_group_t group_num) { TIMER_CHECK(group_num < TIMER_GROUP_MAX, TIMER_GROUP_NUM_ERROR, ESP_ERR_INVALID_ARG); TIMER_ENTER_CRITICAL(&timer_spinlock[group_num]); return ESP_OK; } -esp_err_t timer_spinlock_give(timer_group_t group_num) +esp_err_t IRAM_ATTR timer_spinlock_give(timer_group_t group_num) { TIMER_CHECK(group_num < TIMER_GROUP_MAX, TIMER_GROUP_NUM_ERROR, ESP_ERR_INVALID_ARG); TIMER_EXIT_CRITICAL(&timer_spinlock[group_num]);