Skip to content

Commit

Permalink
Merge pull request #1874 from iNavFlight/dzikuvx-MSP2_INAV_STATUS_fix
Browse files Browse the repository at this point in the history
Read mixer profile from the last byte of MSP frame
  • Loading branch information
DzikuVx authored Oct 31, 2023
2 parents be88b5a + 376bd57 commit ab4b758
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ var mspHelper = (function (gui) {
profile_byte = data.getUint8(offset++)
CONFIG.profile = profile_byte & 0x0F;
CONFIG.battery_profile = (profile_byte & 0xF0) >> 4;
profile_byte = data.getUint8(offset++)
CONFIG.mixer_profile = profile_byte & 0x0F;
CONFIG.armingFlags = data.getUint32(offset, true);
offset += 4;

//As there are 8 bytes for mspBoxModeFlags (number of bytes is actually variable)
//read mixer profile as the last byte in the the message
profile_byte = data.getUint8(dataHandler.message_length_expected - 1);
CONFIG.mixer_profile = profile_byte & 0x0F;

gui.updateStatusBar();
gui.updateProfileChange();
break;
Expand Down

0 comments on commit ab4b758

Please sign in to comment.