Skip to content

Commit 3bd7754

Browse files
committed
Code cleanup
1 parent 33ed0b5 commit 3bd7754

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

tabs/configuration.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -675,22 +675,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
675675
}
676676
function save_sensor_config() {
677677
var next_callback = save_to_eeprom;
678+
678679
if (CONFIG.flightControllerIdentifier == "BTFL" && semver.gte(CONFIG.flightControllerVersion, "2.8.2")) {
679-
if ($('input[name="accHardwareSwitch"]').is(':checked')) {
680-
SENSOR_CONFIG.acc_hardware = 0; // 0 = AUTO
681-
} else {
682-
SENSOR_CONFIG.acc_hardware = 1; // 1 = NONE
683-
}
684-
if ($('input[name="baroHardwareSwitch"]').is(':checked')) {
685-
SENSOR_CONFIG.baro_hardware = 0; // 0 = AUTO
686-
} else {
687-
SENSOR_CONFIG.baro_hardware = 1; // 1 = NONE
688-
}
689-
if ($('input[name="magHardwareSwitch"]').is(':checked')) {
690-
SENSOR_CONFIG.mag_hardware = 0; // 0 = AUTO
691-
} else {
692-
SENSOR_CONFIG.mag_hardware = 1; // 1 = NONE
693-
}
680+
SENSOR_CONFIG.acc_hardware = $('input[name="accHardwareSwitch"]').is(':checked')?0:1;
681+
SENSOR_CONFIG.baro_hardware = $('input[name="baroHardwareSwitch"]').is(':checked')?0:1;
682+
SENSOR_CONFIG.mag_hardware = $('input[name="magHardwareSwitch"]').is(':checked')?0:1
694683
MSP.send_message(MSP_codes.MSP_SET_SENSOR_CONFIG, MSP.crunch(MSP_codes.MSP_SET_SENSOR_CONFIG), false, next_callback);
695684
} else {
696685
next_callback();

0 commit comments

Comments
 (0)