mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-19 04:52:12 +01:00
LP-574 Use loop for ADCRouting
This commit is contained in:
parent
bdf66cafd7
commit
773bc084e5
@ -319,23 +319,13 @@ function batteryModuleEnabled() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function batteryModuleADCConfigured() {
|
function batteryModuleADCConfigured() {
|
||||||
if ((hwSettings.adcRoutingadc0 == HwSettings.ADCRouting.BatteryVoltage) ||
|
for (var adc = 0; adc < 8; adc++) {
|
||||||
(hwSettings.adcRoutingadc0 == HwSettings.ADCRouting.BatteryCurrent) ||
|
var adc_set = hwSettings.getADCRouting(adc);
|
||||||
(hwSettings.adcRoutingadc1 == HwSettings.ADCRouting.BatteryVoltage) ||
|
if (adc_set == HwSettings.ADCRouting.BatteryVoltage) {
|
||||||
(hwSettings.adcRoutingadc1 == HwSettings.ADCRouting.BatteryCurrent) ||
|
|
||||||
(hwSettings.adcRoutingadc2 == HwSettings.ADCRouting.BatteryVoltage) ||
|
|
||||||
(hwSettings.adcRoutingadc2 == HwSettings.ADCRouting.BatteryCurrent) ||
|
|
||||||
(hwSettings.adcRoutingadc3 == HwSettings.ADCRouting.BatteryVoltage) ||
|
|
||||||
(hwSettings.adcRoutingadc3 == HwSettings.ADCRouting.BatteryCurrent) ||
|
|
||||||
(hwSettings.adcRoutingadc4 == HwSettings.ADCRouting.BatteryVoltage) ||
|
|
||||||
(hwSettings.adcRoutingadc4 == HwSettings.ADCRouting.BatteryCurrent) ||
|
|
||||||
(hwSettings.adcRoutingadc5 == HwSettings.ADCRouting.BatteryVoltage) ||
|
|
||||||
(hwSettings.adcRoutingadc5 == HwSettings.ADCRouting.BatteryCurrent) ||
|
|
||||||
(hwSettings.adcRoutingadc6 == HwSettings.ADCRouting.BatteryVoltage) ||
|
|
||||||
(hwSettings.adcRoutingadc6 == HwSettings.ADCRouting.BatteryCurrent) ||
|
|
||||||
(hwSettings.adcRoutingadc7 == HwSettings.ADCRouting.BatteryVoltage) ||
|
|
||||||
(hwSettings.adcRoutingadc7 == HwSettings.ADCRouting.BatteryCurrent)) {
|
|
||||||
return true;
|
return true;
|
||||||
|
} else if (adc_set == HwSettings.ADCRouting.BatteryCurrent) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user