Use API function to configure Brown-out detection within ADC code master
authorNathael Pajani <nathael.pajani@ed3l.fr>
Sun, 31 Aug 2025 13:37:47 +0000 (15:37 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Sun, 31 Aug 2025 13:37:47 +0000 (15:37 +0200)
Update related comments

drivers/adc.c
include/core/system.h

index 3693763..005ee4d 100644 (file)
@@ -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 */
 
        /* 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;
 
        /* Power-up ADC */
        sys_config->powerdown_run_cfg &= ~LPC_POWER_DOWN_ADC;
index c3189f0..c8470e7 100644 (file)
@@ -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)
 /* 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);
 
  */
 void system_brown_out_detection_config(uint32_t level);