mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 03:19:54 +03:00
Store bindings
This commit is contained in:
parent
c7dfab991d
commit
497d0aa674
5 changed files with 144 additions and 16 deletions
|
@ -3,16 +3,13 @@
|
|||
const mspHelper = require('./msp/MSPHelper');
|
||||
const serialPortHelper = require('./serialPortHelper');
|
||||
const FC = require('./fc');
|
||||
const features = require('./feature_framework');
|
||||
|
||||
var wizardSaveFramework = (function () {
|
||||
|
||||
let self = {};
|
||||
|
||||
self.saveSetting = function (config, callback) {
|
||||
/*
|
||||
serialrx_provider to 2
|
||||
serialrx_provider to 6
|
||||
*/
|
||||
|
||||
switch (config.name) {
|
||||
case 'receiverPort':
|
||||
|
@ -22,6 +19,27 @@ var wizardSaveFramework = (function () {
|
|||
case 'receiverProtocol':
|
||||
mspHelper.setSetting('serialrx_provider', config.value, callback);
|
||||
break;
|
||||
case 'gpsPort':
|
||||
console.log(config);
|
||||
|
||||
let gpsBit = FC.getFeatures().find( feature => feature.name === 'GPS' ).bit;
|
||||
|
||||
if (config.value == '-1') {
|
||||
features.unset(gpsBit);
|
||||
|
||||
console.log('Unset GPS');
|
||||
|
||||
} else {
|
||||
features.set(gpsBit);
|
||||
console.log('Set GPS');
|
||||
}
|
||||
break;
|
||||
case 'gpsBaud':
|
||||
console.log(config);
|
||||
break;
|
||||
case 'gpsProtocol':
|
||||
console.log(config);
|
||||
break;
|
||||
default:
|
||||
callback();
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue