diff --git a/applications/app_adc.c b/applications/app_adc.c index 695324df..a0d5966f 100644 --- a/applications/app_adc.c +++ b/applications/app_adc.c @@ -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);