From: Nathael Pajani Date: Sun, 31 Aug 2025 13:37:47 +0000 (+0200) Subject: Use API function to configure Brown-out detection within ADC code X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;p=soft%2Flpc122x%2Fcore Use API function to configure Brown-out detection within ADC code Update related comments --- 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);