mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 20:54:24 +00:00
fix(esp_hw_support): update LACT clock prescale immediately when APB changes on esp32
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "esp_attr.h"
|
||||
#include "hal/assert.h"
|
||||
#include "hal/misc.h"
|
||||
#include "hal/timer_types.h"
|
||||
@@ -331,6 +332,19 @@ static inline volatile void *timer_ll_get_intr_status_reg(timg_dev_t *hw)
|
||||
return &hw->int_st_timers.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set clock prescale for LACT timer
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
* @param divider Prescale value (0 and 1 are not valid)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_set_lact_clock_prescale(timg_dev_t *hw, uint32_t divider)
|
||||
{
|
||||
HAL_ASSERT(divider>=2);
|
||||
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->lactconfig, lact_divider, divider);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user