1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 11:59:51 +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:
Michel Pastor 2018-06-04 22:55:02 +02:00
parent 83bd7ac67f
commit 1b453762a1
6 changed files with 37 additions and 37 deletions

View file

@ -124,16 +124,9 @@ var mspHelper = (function (gui) {
case MSPCodes.MSP_ACTIVEBOXES:
var words = dataHandler.message_length_expected / 4;
CONFIG.mode = 0;
if (words == 1) {
CONFIG.mode = data.getUint32(0, true);
}
else if (words == 2) {
CONFIG.mode = data.getUint32(0, true) | (data.getUint32(4, true) << 32);
}
else {
console.log('MSP_ACTIVEBOXES doesn\'t support more than 53 bits at the moment');
}
CONFIG.mode = [];
for (i = 0; i < words; ++i)
CONFIG.mode.push(data.getUint32(i * 4, true));
break;
case MSPCodes.MSP_SENSOR_STATUS: