fixes detached ADC1 not being mapped

This commit is contained in:
kawaiinekololis 2023-10-31 04:35:18 +01:00
parent 8c1e6c53de
commit f08c8602fe
1 changed files with 5 additions and 5 deletions

View File

@ -201,6 +201,11 @@ static THD_FUNCTION(adc_thread, arg) {
range_ok = read_voltage >= config.voltage_min && read_voltage <= config.voltage_max;
// Override pwr value, when used from LISP
if (adc_detached == 1 || adc_detached == 2) {
pwr = adc1_override;
}
// Map the read voltage
switch (config.ctrl_type) {
case ADC_CTRL_TYPE_CURRENT_REV_CENTER:
@ -224,11 +229,6 @@ static THD_FUNCTION(adc_thread, arg) {
break;
}
// Override pwr value, when used from LISP
if (adc_detached == 1 || adc_detached == 2) {
pwr = adc1_override;
}
// Optionally apply a filter
static float pwr_filter = 0.0;
UTILS_LP_MOVING_AVG_APPROX(pwr_filter, pwr, FILTER_SAMPLES);