fix(ledc): fix potential null dereference issue & add test case

This commit is contained in:
Chen Chen
2025-11-19 11:59:51 +08:00
parent 2ce6e22986
commit b3d80b2e5d
4 changed files with 60 additions and 14 deletions
+11 -8
View File
@@ -396,14 +396,6 @@ void ledc_hal_get_fade_end_intr_status(ledc_hal_context_t *hal, uint32_t *intr_s
*/
void ledc_hal_clear_fade_end_intr_status(ledc_hal_context_t *hal, ledc_channel_t channel_num);
/**
* @brief Get the address of the fade end interrupt status register.
*
* @param hal Context of the HAL layer
* @return Pointer to the fade end interrupt status register.
*/
volatile void* ledc_hal_get_fade_end_intr_addr(ledc_hal_context_t *hal);
/**
* @brief Get clock config of LEDC timer
*
@@ -415,6 +407,17 @@ volatile void* ledc_hal_get_fade_end_intr_addr(ledc_hal_context_t *hal);
*/
void ledc_hal_get_clk_cfg(ledc_hal_context_t *hal, ledc_timer_t timer_sel, ledc_clk_cfg_t *clk_cfg);
/**
* @brief Get the address of the fade end interrupt status register.
*
* @param hal Context of the HAL layer
* @return Pointer to the fade end interrupt status register.
*/
static inline volatile void* ledc_hal_get_fade_end_intr_addr(ledc_hal_context_t *hal)
{
return ledc_ll_get_fade_end_intr_addr(hal->dev);
}
#endif //#if SOC_LEDC_SUPPORTED
#ifdef __cplusplus