1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 09:45:33 +03:00

Implement MSP2_INAV_STATUS as a variation an improved MSP_STATUS_EX,

providing a 32 bit armingFlags (no other changes).
This commit is contained in:
Jonathan Hudson 2017-11-01 17:36:43 +00:00
parent 733e425045
commit 73b4f3157c
2 changed files with 13 additions and 6 deletions

View file

@ -355,6 +355,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
} }
break; break;
case MSP2_INAV_STATUS:
case MSP_STATUS_EX: case MSP_STATUS_EX:
case MSP_STATUS: case MSP_STATUS:
{ {
@ -371,9 +372,12 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
sbufWriteData(dst, &mspBoxModeFlags, 4); sbufWriteData(dst, &mspBoxModeFlags, 4);
sbufWriteU8(dst, getConfigProfile()); sbufWriteU8(dst, getConfigProfile());
if (cmdMSP == MSP_STATUS_EX) { if (cmdMSP != MSP_STATUS) {
sbufWriteU16(dst, averageSystemLoadPercent); sbufWriteU16(dst, averageSystemLoadPercent);
sbufWriteU16(dst, armingFlags); if (cmdMSP == MSP2_INAV_STATUS)
sbufWriteU32(dst, armingFlags);
else
sbufWriteU16(dst, armingFlags);
sbufWriteU8(dst, accGetCalibrationAxisFlags()); sbufWriteU8(dst, accGetCalibrationAxisFlags());
} }
} }
@ -1099,13 +1103,13 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
uint8_t band=0, channel=0; uint8_t band=0, channel=0;
vtxCommonGetBandAndChannel(&band,&channel); vtxCommonGetBandAndChannel(&band,&channel);
uint8_t powerIdx=0; // debug uint8_t powerIdx=0; // debug
vtxCommonGetPowerIndex(&powerIdx); vtxCommonGetPowerIndex(&powerIdx);
uint8_t pitmode=0; uint8_t pitmode=0;
vtxCommonGetPitMode(&pitmode); vtxCommonGetPitMode(&pitmode);
sbufWriteU8(dst, deviceType); sbufWriteU8(dst, deviceType);
sbufWriteU8(dst, band); sbufWriteU8(dst, band);
sbufWriteU8(dst, channel); sbufWriteU8(dst, channel);

View file

@ -15,4 +15,7 @@
* along with INAV. If not, see <http://www.gnu.org/licenses/>. * along with INAV. If not, see <http://www.gnu.org/licenses/>.
*/ */
//#define MSP2_INAV_STATUS 0x1000 // iNav specific IDs start from 0x2000
// See https://github.com/iNavFlight/inav/wiki/MSP-V2#msp-v2-message-catalogue
#define MSP2_INAV_STATUS 0x2000