mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 04:15:28 +03:00
Fix bug in MSP_ACTIVEBOXES decoding
In JS `(1<<32) == 1` so it was causing an issue when the FC was advertising more than 32 mode boxes
This commit is contained in:
parent
83bd7ac67f
commit
1b453762a1
6 changed files with 37 additions and 37 deletions
15
js/fc.js
15
js/fc.js
|
@ -95,7 +95,7 @@ var FC = {
|
|||
cycleTime: 0,
|
||||
i2cError: 0,
|
||||
activeSensors: 0,
|
||||
mode: 0,
|
||||
mode: [],
|
||||
profile: 0,
|
||||
uid: [0, 0, 0],
|
||||
accelerometerTrims: [0, 0],
|
||||
|
@ -1081,5 +1081,18 @@ var FC = {
|
|||
},
|
||||
getServoMixInputName: function (input) {
|
||||
return getServoMixInputNames()[input];
|
||||
},
|
||||
getModeId: function (name) {
|
||||
for (var i = 0; i < AUX_CONFIG.length; i++) {
|
||||
if (AUX_CONFIG[i] == name)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
isModeBitSet: function (i) {
|
||||
return bit_check(CONFIG.mode[Math.trunc(i / 32)], i % 32);
|
||||
},
|
||||
isModeEnabled: function (name) {
|
||||
return FC.isModeBitSet(FC.getModeId(name));
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue