1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 00:35:20 +03:00

Correctly set GPS feature flag

This commit is contained in:
Pawel Spychalski (DzikuVx) 2024-06-17 14:12:59 +02:00
parent 5c7a6be54e
commit 7b63e06521
2 changed files with 4 additions and 5 deletions

View file

@ -112,6 +112,7 @@ var defaultsDialog = (function () {
$container.hide(); $container.hide();
wizardSaveFramework.persist(privateScope.wizardSettings, function () { wizardSaveFramework.persist(privateScope.wizardSettings, function () {
//FIXME this has to be enabled when the settings are saved
// mspHelper.saveToEeprom(function () { // mspHelper.saveToEeprom(function () {
// //noinspection JSUnresolvedVariable // //noinspection JSUnresolvedVariable
// GUI.log(i18n.getMessage('configurationEepromSaved')); // GUI.log(i18n.getMessage('configurationEepromSaved'));
@ -376,6 +377,7 @@ var defaultsDialog = (function () {
privateScope.onInitSettingReturned = function (promise) { privateScope.onInitSettingReturned = function (promise) {
//FIXME: This is a workaround to avoid applying defaults when the settings are already applied
// if (promise.value > 0) { // if (promise.value > 0) {
// return; //Defaults were applied, we can just ignore // return; //Defaults were applied, we can just ignore
// } // }

View file

@ -20,19 +20,16 @@ var wizardSaveFramework = (function () {
mspHelper.setSetting('serialrx_provider', config.value, callback); mspHelper.setSetting('serialrx_provider', config.value, callback);
break; break;
case 'gpsPort': case 'gpsPort':
console.log(config);
let gpsBit = FC.getFeatures().find( feature => feature.name === 'GPS' ).bit; let gpsBit = FC.getFeatures().find( feature => feature.name === 'GPS' ).bit;
if (config.value == '-1') { if (config.value == '-1') {
features.unset(gpsBit); features.unset(gpsBit);
console.log('Unset GPS');
} else { } else {
features.set(gpsBit); features.set(gpsBit);
console.log('Set GPS');
} }
features.execute(callback);
break; break;
case 'gpsBaud': case 'gpsBaud':
console.log(config); console.log(config);