mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(rtc_timer): disable target before setting wakeup time to avoid intermediate states
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -103,11 +103,23 @@ FORCE_INLINE_ATTR void rtc_timer_ll_alarm_intr_enable(lp_timer_dev_t *dev, uint8
|
||||
*/
|
||||
FORCE_INLINE_ATTR void rtc_timer_ll_set_wakeup_time(uint8_t timer_id, uint64_t ticks)
|
||||
{
|
||||
rtc_timer_ll_set_target_enable(&LP_TIMER, timer_id, false);
|
||||
rtc_timer_ll_clear_alarm_intr_status(&LP_TIMER, timer_id);
|
||||
rtc_timer_ll_set_alarm_target(&LP_TIMER, timer_id, ticks);
|
||||
rtc_timer_ll_set_target_enable(&LP_TIMER, timer_id, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear/disarm the wakeup timer alarm enabled by rtc_timer_ll_set_wakeup_time()
|
||||
*
|
||||
* @param timer_id Timer ID
|
||||
*/
|
||||
FORCE_INLINE_ATTR void rtc_timer_ll_clear_wakeup_time(uint8_t timer_id)
|
||||
{
|
||||
rtc_timer_ll_set_target_enable(&LP_TIMER, timer_id, false);
|
||||
rtc_timer_ll_clear_alarm_intr_status(&LP_TIMER, timer_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get current RTC timer cycle count
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user