From 3797de6f44be766344ce0492999b572d76c8318d Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Sun, 31 Aug 2025 15:37:47 +0200 Subject: [PATCH] Use API function to configure Brown-out detection within ADC code Update related comments --- drivers/adc.c | 2 +- include/core/system.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/adc.c b/drivers/adc.c index 3693763..005ee4d 100644 --- a/drivers/adc.c +++ b/drivers/adc.c @@ -205,7 +205,7 @@ void adc_on(void (*adc_callback)(uint32_t)) /* Brown-Out detection must be powered to operate the ADC. * See Section 19.2 of UM10441 revision 2.1 or newer for more information */ - sys_config->powerdown_run_cfg &= ~LPC_POWER_DOWN_BOD; + system_brown_out_detection_config(1); /* Power-up ADC */ sys_config->powerdown_run_cfg &= ~LPC_POWER_DOWN_ADC; diff --git a/include/core/system.h b/include/core/system.h index c3189f0..c8470e7 100644 --- a/include/core/system.h +++ b/include/core/system.h @@ -117,6 +117,7 @@ uint8_t subsystem_powered(uint32_t power_bit); /* Configure the brown-out detection. * Note: Brown-Out detection must be powered to operate the ADC (See Section 19.2 * of UM10441 revision 2.1 or newer for more information) + * This is done automatically inside of adc_on() */ void system_brown_out_detection_config(uint32_t level); -- 2.43.0