File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -667,7 +667,10 @@ static void IRAM_ATTR do_switch(pm_mode_t new_mode)
667667#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
668668 esp_clk_utils_mspi_speed_mode_sync_before_cpu_freq_switching (new_config .source_freq_mhz , new_config .freq_mhz );
669669#endif
670+ extern portMUX_TYPE s_time_update_lock ;
671+ portENTER_CRITICAL_SAFE (& s_time_update_lock );
670672 rtc_clk_cpu_freq_set_config_fast (& new_config );
673+ portEXIT_CRITICAL_SAFE (& s_time_update_lock );
671674#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
672675 esp_clk_utils_mspi_speed_mode_sync_after_cpu_freq_switching (new_config .source_freq_mhz , new_config .freq_mhz );
673676#endif
Original file line number Diff line number Diff line change @@ -276,7 +276,9 @@ esp_err_t esp_timer_impl_init(intr_handler_t alarm_handler)
276276 * will not cause issues in practice.
277277 */
278278 REG_SET_BIT (INT_ENA_REG , TIMG_LACT_INT_ENA );
279+ portENTER_CRITICAL_SAFE (& s_time_update_lock );
279280 timer_ll_set_lact_clock_prescale (TIMER_LL_GET_HW (LACT_MODULE ), esp_clk_apb_freq () / MHZ / LACT_TICKS_PER_US );
281+ portEXIT_CRITICAL_SAFE (& s_time_update_lock );
280282 // Set the step for the sleep mode when the timer will work
281283 // from a slow_clk frequency instead of the APB frequency.
282284 uint32_t slowclk_ticks_per_us = esp_clk_slowclk_cal_get () * LACT_TICKS_PER_US ;
You can’t perform that action at this time.
0 commit comments