mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Extend OSD warnings storage to 32bits; add count to MSP
Extends the possible OSD warnings elements from 16 to 32. Adds a warnings count to MSP data to enable improved handling of warnings added to the firmware but not in the Configurator. Incremental Configurator development required.
This commit is contained in:
parent
2fdf48b415
commit
05cc74a4ae
3 changed files with 15 additions and 5 deletions
|
@ -766,7 +766,11 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
|
|||
}
|
||||
|
||||
// Enabled warnings
|
||||
sbufWriteU16(dst, osdConfig()->enabledWarnings);
|
||||
// Send low word first for backwards compatibility (API < 1.41)
|
||||
sbufWriteU16(dst, (uint16_t)(osdConfig()->enabledWarnings & 0xFFFF));
|
||||
// API >= 1.41; send the count and 32bit warnings
|
||||
sbufWriteU8(dst, OSD_WARNING_COUNT);
|
||||
sbufWriteU32(dst, osdConfig()->enabledWarnings);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
@ -2493,8 +2497,14 @@ static mspResult_e mspCommonProcessInCommand(uint8_t cmdMSP, sbuf_t *src, mspPos
|
|||
|
||||
if (sbufBytesRemaining(src) >= 2) {
|
||||
/* Enabled warnings */
|
||||
// API < 1.41 supports only the low 16 bits
|
||||
osdConfigMutable()->enabledWarnings = sbufReadU16(src);
|
||||
}
|
||||
|
||||
if (sbufBytesRemaining(src) >= 4) {
|
||||
// 32bit version of enabled warnings (API >= 1.41)
|
||||
osdConfigMutable()->enabledWarnings = sbufReadU32(src);
|
||||
}
|
||||
#endif
|
||||
} else if ((int8_t)addr == -2) {
|
||||
#if defined(USE_OSD)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue