mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-16 12:55:13 +03:00
Remove MSP_BOXNAMES from the codebase
This commit is contained in:
parent
3244df1f8b
commit
5c7b5f1a0f
3 changed files with 6 additions and 20 deletions
10
js/fc.js
10
js/fc.js
|
@ -950,11 +950,13 @@ var FC = {
|
|||
return this.getServoMixInputNames()[input];
|
||||
},
|
||||
getModeId: function (name) {
|
||||
for (var i = 0; i < this.AUX_CONFIG.length; i++) {
|
||||
if (this.AUX_CONFIG[i] == name)
|
||||
return i;
|
||||
}
|
||||
|
||||
let mode = FLIGHT_MODES.find( mode => mode.boxName === name );
|
||||
if (mode) {
|
||||
return mode.permanentId;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
},
|
||||
isModeBitSet: function (i) {
|
||||
return BitHelper.bit_check(this.CONFIG.mode[Math.trunc(i / 32)], i % 32);
|
||||
|
|
|
@ -84,7 +84,6 @@ var MSPCodes = {
|
|||
MSP_PID: 112,
|
||||
MSP_ACTIVEBOXES: 113,
|
||||
MSP_MOTOR_PINS: 115,
|
||||
MSP_BOXNAMES: 116,
|
||||
MSP_PIDNAMES: 117,
|
||||
MSP_WP: 118,
|
||||
MSP_BOXIDS: 119,
|
||||
|
|
|
@ -386,21 +386,6 @@ var mspHelper = (function () {
|
|||
case MSPCodes.MSP_MOTOR_PINS:
|
||||
console.log(data);
|
||||
break;
|
||||
case MSPCodes.MSP_BOXNAMES:
|
||||
//noinspection JSUndeclaredVariable
|
||||
FC.AUX_CONFIG = []; // empty the array as new data is coming in
|
||||
buff = [];
|
||||
for (let i = 0; i < data.byteLength; i++) {
|
||||
if (data.getUint8(i) == 0x3B) { // ; (delimeter char)
|
||||
FC.AUX_CONFIG.push(String.fromCharCode.apply(null, buff)); // convert bytes into ASCII and save as strings
|
||||
|
||||
// empty buffer
|
||||
buff = [];
|
||||
} else {
|
||||
buff.push(data.getUint8(i));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MSPCodes.MSP_PIDNAMES:
|
||||
//noinspection JSUndeclaredVariable
|
||||
FC.PID_names = []; // empty the array as new data is coming in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue