mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/gptimer_alarm_config_in_sram' into 'master'
feat(gptimer): check the alarm config is not in flash See merge request espressif/esp-idf!30098
This commit is contained in:
commit
906ce8e0ff
@ -272,6 +272,9 @@ esp_err_t gptimer_set_alarm_action(gptimer_handle_t timer, const gptimer_alarm_c
|
||||
{
|
||||
ESP_RETURN_ON_FALSE_ISR(timer, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
|
||||
if (config) {
|
||||
#if CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM
|
||||
ESP_RETURN_ON_FALSE_ISR(esp_ptr_internal(config), ESP_ERR_INVALID_ARG, TAG, "alarm config struct not in internal RAM");
|
||||
#endif
|
||||
// When auto_reload is enabled, alarm_count should not be equal to reload_count
|
||||
bool valid_auto_reload = !config->flags.auto_reload_on_alarm || config->alarm_count != config->reload_count;
|
||||
ESP_RETURN_ON_FALSE_ISR(valid_auto_reload, ESP_ERR_INVALID_ARG, TAG, "reload count can't equal to alarm count");
|
||||
|
@ -334,9 +334,6 @@ static void test_rmt_receive_filter(rmt_clock_source_t clk_src)
|
||||
rmt_channel_handle_t rx_channel = NULL;
|
||||
TEST_ESP_OK(rmt_new_rx_channel(&rx_channel_cfg, &rx_channel));
|
||||
|
||||
// initialize the GPIO level to low
|
||||
TEST_ESP_OK(gpio_set_level(TEST_RMT_GPIO_NUM_A, 0));
|
||||
|
||||
printf("register rx event callbacks\r\n");
|
||||
rmt_rx_event_callbacks_t cbs = {
|
||||
.on_recv_done = test_rmt_received_done,
|
||||
|
@ -203,9 +203,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles)
|
||||
{
|
||||
/* On ESP32-C2, choosing RTC_CAL_RTC_MUX results in calibration of
|
||||
* the 150k RTC clock regardless of the currenlty selected SLOW_CLK.
|
||||
* the 150k RTC clock regardless of the currently selected SLOW_CLK.
|
||||
* On the ESP32, it used the currently selected SLOW_CLK.
|
||||
* The following code emulates ESP32 behavior:
|
||||
*/
|
||||
@ -203,9 +203,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles)
|
||||
{
|
||||
/* On ESP32C3, choosing RTC_CAL_RTC_MUX results in calibration of
|
||||
* the 150k RTC clock regardless of the currenlty selected SLOW_CLK.
|
||||
* the 150k RTC clock regardless of the currently selected SLOW_CLK.
|
||||
* On the ESP32, it used the currently selected SLOW_CLK.
|
||||
* The following code emulates ESP32 behavior:
|
||||
*/
|
||||
@ -206,9 +206,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ static uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cyc
|
||||
|
||||
/* Enable requested clock (150k clock is always on) */
|
||||
// All clocks on/off takes time to be stable, so we shouldn't frequently enable/disable the clock
|
||||
// Only enable if orignally was disabled, and set back to the disable state after calibration is done
|
||||
// Only enable if originally was disabled, and set back to the disable state after calibration is done
|
||||
// If the clock is already on, then do nothing
|
||||
bool dig_32k_xtal_enabled = clk_ll_xtal32k_digi_is_enabled();
|
||||
if (cal_clk == RTC_CAL_32K_XTAL && !dig_32k_xtal_enabled) {
|
||||
@ -277,9 +277,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ static uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cyc
|
||||
|
||||
/* Enable requested clock (150k clock is always on) */
|
||||
// All clocks on/off takes time to be stable, so we shouldn't frequently enable/disable the clock
|
||||
// Only enable if orignally was disabled, and set back to the disable state after calibration is done
|
||||
// Only enable if originally was disabled, and set back to the disable state after calibration is done
|
||||
// If the clock is already on, then do nothing
|
||||
bool dig_32k_xtal_enabled = clk_ll_xtal32k_digi_is_enabled();
|
||||
if (cal_clk == RTC_CAL_32K_XTAL && !dig_32k_xtal_enabled) {
|
||||
@ -283,9 +283,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -280,9 +280,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ static uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cyc
|
||||
|
||||
/* Enable requested clock (150k clock is always on) */
|
||||
// All clocks on/off takes time to be stable, so we shouldn't frequently enable/disable the clock
|
||||
// Only enable if orignally was disabled, and set back to the disable state after calibration is done
|
||||
// Only enable if originally was disabled, and set back to the disable state after calibration is done
|
||||
// If the clock is already on, then do nothing
|
||||
bool dig_32k_xtal_enabled = clk_ll_xtal32k_digi_is_enabled();
|
||||
if (cal_clk == RTC_CAL_32K_XTAL && !dig_32k_xtal_enabled) {
|
||||
@ -283,9 +283,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles)
|
||||
|
||||
/* Enable requested clock (some clocks are always on) */
|
||||
// All clocks on/off takes time to be stable, so we shouldn't frequently enable/disable the clock
|
||||
// Only enable if orignally was disabled, and set back to the disable state after calibration is done
|
||||
// Only enable if originally was disabled, and set back to the disable state after calibration is done
|
||||
// If the clock is already on, then do nothing
|
||||
bool dig_32k_xtal_enabled = clk_ll_xtal32k_digi_is_enabled();
|
||||
if (cal_clk == RTC_CAL_32K_XTAL && !dig_32k_xtal_enabled) {
|
||||
@ -240,9 +240,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ static uint32_t rtc_clk_cal_internal_cycling(rtc_cal_sel_t cal_clk, uint32_t slo
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Slowclk period calculating funtion used by rtc_clk_cal and rtc_clk_cal_cycling
|
||||
* @brief Slowclk period calculating function used by rtc_clk_cal and rtc_clk_cal_cycling
|
||||
* @param xtal_cycles number of xtal cycles count
|
||||
* @param slowclk_cycles number of slow clock cycles to count
|
||||
* @return slow clock period
|
||||
@ -140,7 +140,7 @@ static uint32_t rtc_clk_xtal_to_slowclk(uint64_t xtal_cycles, uint32_t slowclk_c
|
||||
uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles, uint32_t cal_mode)
|
||||
{
|
||||
/* On ESP32S2, choosing RTC_CAL_RTC_MUX results in calibration of
|
||||
* the 90k RTC clock regardless of the currenlty selected SLOW_CLK.
|
||||
* the 90k RTC clock regardless of the currently selected SLOW_CLK.
|
||||
* On the ESP32, it used the currently selected SLOW_CLK.
|
||||
* The following code emulates ESP32 behavior:
|
||||
*/
|
||||
@ -271,9 +271,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles)
|
||||
{
|
||||
/* On ESP32S3, choosing RTC_CAL_RTC_MUX results in calibration of
|
||||
* the 150k RTC clock regardless of the currenlty selected SLOW_CLK.
|
||||
* the 150k RTC clock regardless of the currently selected SLOW_CLK.
|
||||
* On the ESP32, it used the currently selected SLOW_CLK.
|
||||
* The following code emulates ESP32 behavior:
|
||||
*/
|
||||
@ -205,9 +205,7 @@ static void enable_timer_group0_for_calibration(void)
|
||||
}
|
||||
}
|
||||
#else
|
||||
// no critical section is needed for bootloader
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV;
|
||||
timer_ll_enable_bus_clock(0, true);
|
||||
timer_ll_reset_register(0);
|
||||
_timer_ll_enable_bus_clock(0, true);
|
||||
_timer_ll_reset_register(0);
|
||||
#endif
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
DPORT_WRITE_PERI_REG(DPORT_PERIP_RST_EN_REG, DPORT_TIMERGROUP_RST);
|
||||
@ -71,7 +71,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -166,7 +166,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
@ -49,7 +49,7 @@ static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
(void)group_id;
|
||||
SYSTEM.perip_rst_en0.timergroup_rst = 1;
|
||||
@ -59,7 +59,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -154,7 +154,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
@ -52,7 +52,7 @@ static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
SYSTEM.perip_rst_en0.reg_timergroup_rst = 1;
|
||||
@ -67,7 +67,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -162,7 +162,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
@ -34,7 +34,7 @@ extern "C" {
|
||||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
PCR.timergroup0_conf.tg0_clk_en = enable;
|
||||
@ -45,7 +45,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
@ -56,7 +56,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
PCR.timergroup0_conf.tg0_rst_en = 1;
|
||||
@ -71,7 +71,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -197,7 +197,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
@ -79,7 +79,7 @@ static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
PCR.timergroup0_conf.tg0_rst_en = 1;
|
||||
@ -94,7 +94,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -203,7 +203,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
@ -59,7 +59,7 @@ extern "C" {
|
||||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
PCR.timergroup0_conf.tg0_clk_en = enable;
|
||||
@ -70,7 +70,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
@ -81,7 +81,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
PCR.timergroup0_conf.tg0_rst_en = 1;
|
||||
@ -96,7 +96,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -205,7 +205,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
@ -79,7 +79,7 @@ static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
PCR.timergroup0_conf.tg0_rst_en = 1;
|
||||
@ -94,7 +94,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -203,7 +203,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
@ -109,7 +109,7 @@ static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
HP_SYS_CLKRST.hp_rst_en1.reg_rst_en_timergrp0 = 1;
|
||||
@ -124,7 +124,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -255,7 +255,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
@ -56,7 +56,7 @@ static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
WRITE_PERI_REG(DPORT_PERIP_RST_EN0_REG, DPORT_TIMERGROUP_RST_M);
|
||||
@ -71,7 +71,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -170,7 +170,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
@ -52,7 +52,7 @@ static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
*
|
||||
* @param group_id Group ID
|
||||
*/
|
||||
static inline void timer_ll_reset_register(int group_id)
|
||||
static inline void _timer_ll_reset_register(int group_id)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
SYSTEM.perip_rst_en0.timergroup_rst = 1;
|
||||
@ -67,7 +67,7 @@ static inline void timer_ll_reset_register(int group_id)
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_reset_register(__VA_ARGS__)
|
||||
#define timer_ll_reset_register(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_reset_register(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set clock source for timer
|
||||
@ -165,7 +165,7 @@ static inline void timer_ll_set_count_direction(timg_dev_t *hw, uint32_t timer_n
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable timer, start couting
|
||||
* @brief Enable timer, start counting
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
|
Loading…
Reference in New Issue
Block a user