mirror of https://github.com/rusefi/bldc.git
fixes detached ADC1 not being mapped
This commit is contained in:
parent
8c1e6c53de
commit
f08c8602fe
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue