Move ADC peripheral setup to devicetree

Remove the ADC channel configuration from the board.h files and use new
DT macros to configure the ADC peripheral based on board.dts only.
This commit is contained in:
Martin Jäger
2020-07-20 09:07:31 +02:00
parent 1b6c56d25b
commit d283436747
21 changed files with 337 additions and 261 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ void PwmSwitch::test()
}
else if (!pwm_active() && enable == true) {
// turning the PWM switch on creates a short voltage rise, so inhibit alerts by 50 ms
adc_upper_alert_inhibit(ADC_POS_V_LOW, 50);
adc_upper_alert_inhibit(ADC_POS(v_low), 50);
pwm_signal_start(0.9);
print_info("PWM test mode start.\n");
}
@@ -118,7 +118,7 @@ void PwmSwitch::control()
&& enable == true)
{
// turning the PWM switch on creates a short voltage rise, so inhibit alerts by 50 ms
adc_upper_alert_inhibit(ADC_POS_V_LOW, 50);
adc_upper_alert_inhibit(ADC_POS(v_low), 50);
pwm_signal_start(1);
power_good_timestamp = uptime();
print_info("PWM charger start.\n");