refactor(bod): Move bod hal to pmu hal component

This commit is contained in:
C.S.M
2025-12-24 11:43:14 +08:00
parent cdcb4cbce8
commit 39ea6efc7c
19 changed files with 11 additions and 21 deletions
+8
View File
@@ -21,6 +21,14 @@ if(CONFIG_SOC_PAU_SUPPORTED)
list(APPEND srcs "${target}/pau_hal.c")
endif()
if(CONFIG_SOC_BOD_SUPPORTED)
list(APPEND srcs "brownout_hal.c")
endif()
if(CONFIG_SOC_VBAT_SUPPORTED)
list(APPEND srcs "vbat_hal.c")
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${public_include}
REQUIRES soc hal esp_rom
@@ -123,7 +123,6 @@ static inline void brownout_ll_clear_count(void)
// Not supported on esp32
}
#ifdef __cplusplus
}
#endif
@@ -18,7 +18,6 @@
#include "hal/regi2c_ctrl.h"
#include "soc/regi2c_brownout.h"
typedef enum {
VBAT_LL_CHARGER_UPVOLTAGE_INTR = BIT(27),
VBAT_LL_CHARGER_UNDERVOLTAGE_INTR = BIT(28),
@@ -19,7 +19,6 @@
#include "hal/regi2c_ctrl.h"
#include "soc/regi2c_brownout.h"
typedef enum {
VBAT_LL_CHARGER_UPVOLTAGE_INTR = BIT(27),
VBAT_LL_CHARGER_UNDERVOLTAGE_INTR = BIT(28),
@@ -73,7 +72,7 @@ static inline void vbat_ll_enable_charger_comparator(bool enable)
*/
static inline void vbat_ll_set_undervoltage_filter_time(uint32_t time_tick)
{
HAL_ASSERT(time_tick < (2<<10));
HAL_ASSERT(time_tick < (2 << 10));
LP_ANA_PERI.vddbat_charge_cntl.vddbat_charge_undervoltage_target = time_tick;
}
@@ -84,7 +83,7 @@ static inline void vbat_ll_set_undervoltage_filter_time(uint32_t time_tick)
*/
static inline void vbat_ll_set_upvoltage_filter_time(uint32_t time_tick)
{
HAL_ASSERT(time_tick < (2<<10));
HAL_ASSERT(time_tick < (2 << 10));
LP_ANA_PERI.vddbat_charge_cntl.vddbat_charge_upvoltage_target = time_tick;
}
@@ -127,7 +127,6 @@ static inline void brownout_ll_clear_count(void)
RTCCNTL.brown_out.cnt_clr = 0;
}
#ifdef __cplusplus
}
#endif
@@ -132,7 +132,6 @@ static inline void brownout_ll_clear_count(void)
RTCCNTL.brown_out.cnt_clr = 0;
}
#ifdef __cplusplus
}
#endif
@@ -36,7 +36,6 @@ typedef struct {
*/
void brownout_hal_config(const brownout_hal_config_t *cfg);
#ifdef __cplusplus
}
#endif
+1 -13
View File
@@ -33,11 +33,7 @@ else()
endif()
endif()
if(esp_tee_build)
if(CONFIG_SOC_BOD_SUPPORTED)
list(APPEND srcs "brownout_hal.c")
endif()
elseif(NOT BOOTLOADER_BUILD)
if(NOT esp_tee_build AND NOT BOOTLOADER_BUILD)
list(APPEND srcs "color_hal.c")
if(CONFIG_SOC_SYSTIMER_SUPPORTED AND NOT CONFIG_HAL_SYSTIMER_USE_ROM_IMPL)
@@ -60,14 +56,6 @@ elseif(NOT BOOTLOADER_BUILD)
list(APPEND srcs "${target}/modem_clock_hal.c")
endif()
if(CONFIG_SOC_BOD_SUPPORTED)
list(APPEND srcs "brownout_hal.c")
endif()
if(CONFIG_SOC_VBAT_SUPPORTED)
list(APPEND srcs "vbat_hal.c")
endif()
endif()
idf_component_register(SRCS ${srcs}