mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
refactor(sdm): add check and error info to the clock division
This commit is contained in:

committed by
Kevin (Lao Kaiyao)

parent
d8d57e1965
commit
d9d316b97d
@@ -15,6 +15,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SDM_LL_PRESCALE_MAX 256
|
||||
|
||||
/**
|
||||
* @brief Set Sigma-delta enable
|
||||
*
|
||||
@@ -49,7 +51,7 @@ static inline void sdm_ll_set_pulse_density(gpio_sd_dev_t *hw, int channel, int8
|
||||
*/
|
||||
static inline void sdm_ll_set_prescale(gpio_sd_dev_t *hw, int channel, uint32_t prescale)
|
||||
{
|
||||
HAL_ASSERT(prescale && prescale <= 256);
|
||||
HAL_ASSERT(prescale && prescale <= SDM_LL_PRESCALE_MAX);
|
||||
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->channel[channel], prescale, prescale - 1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user