mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 21:24:32 +02:00
fix(esp_timer): fix isr safe when CONFIG_FREERTOS_USE_TICKLESS_IDLE and PM_ENABLE
This commit is contained in:
@@ -979,6 +979,7 @@ esp_err_t spi_bus_free(spi_host_device_t host_id)
|
|||||||
sleep_retention_module_deinit(retention_id);
|
sleep_retention_module_deinit(retention_id);
|
||||||
}
|
}
|
||||||
_lock_release(&ctx->mutex);
|
_lock_release(&ctx->mutex);
|
||||||
|
_lock_close(&ctx->mutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_PM_ENABLE
|
#ifdef CONFIG_PM_ENABLE
|
||||||
|
@@ -222,11 +222,11 @@ static void IRAM_ATTR timer_alarm_isr(void *arg)
|
|||||||
|
|
||||||
void IRAM_ATTR esp_timer_impl_update_apb_freq(uint32_t apb_ticks_per_us)
|
void IRAM_ATTR esp_timer_impl_update_apb_freq(uint32_t apb_ticks_per_us)
|
||||||
{
|
{
|
||||||
portENTER_CRITICAL(&s_time_update_lock);
|
portENTER_CRITICAL_SAFE(&s_time_update_lock);
|
||||||
assert(apb_ticks_per_us >= 3 && "divider value too low");
|
assert(apb_ticks_per_us >= 3 && "divider value too low");
|
||||||
assert(apb_ticks_per_us % TICKS_PER_US == 0 && "APB frequency (in MHz) should be divisible by TICK_PER_US");
|
assert(apb_ticks_per_us % TICKS_PER_US == 0 && "APB frequency (in MHz) should be divisible by TICK_PER_US");
|
||||||
REG_SET_FIELD(CONFIG_REG, TIMG_LACT_DIVIDER, apb_ticks_per_us / TICKS_PER_US);
|
REG_SET_FIELD(CONFIG_REG, TIMG_LACT_DIVIDER, apb_ticks_per_us / TICKS_PER_US);
|
||||||
portEXIT_CRITICAL(&s_time_update_lock);
|
portEXIT_CRITICAL_SAFE(&s_time_update_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void esp_timer_impl_set(uint64_t new_us)
|
void esp_timer_impl_set(uint64_t new_us)
|
||||||
|
Reference in New Issue
Block a user