Skip to content

Commit ab4b758

Browse files
authored
Merge pull request #1874 from iNavFlight/dzikuvx-MSP2_INAV_STATUS_fix
Read mixer profile from the last byte of MSP frame
2 parents be88b5a + 376bd57 commit ab4b758

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

js/msp/MSPHelper.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ var mspHelper = (function (gui) {
7979
profile_byte = data.getUint8(offset++)
8080
CONFIG.profile = profile_byte & 0x0F;
8181
CONFIG.battery_profile = (profile_byte & 0xF0) >> 4;
82-
profile_byte = data.getUint8(offset++)
83-
CONFIG.mixer_profile = profile_byte & 0x0F;
8482
CONFIG.armingFlags = data.getUint32(offset, true);
8583
offset += 4;
84+
85+
//As there are 8 bytes for mspBoxModeFlags (number of bytes is actually variable)
86+
//read mixer profile as the last byte in the the message
87+
profile_byte = data.getUint8(dataHandler.message_length_expected - 1);
88+
CONFIG.mixer_profile = profile_byte & 0x0F;
89+
8690
gui.updateStatusBar();
8791
gui.updateProfileChange();
8892
break;

0 commit comments

Comments
 (0)