1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Add MSP_BEEPER_CONFIG and MSP_SET_BEEPER_CONFIG for beeper configuration

This commit is contained in:
Bas Delfos 2017-07-25 22:19:50 +02:00
parent 43a84175e9
commit 47c95f9a6d
2 changed files with 16 additions and 0 deletions

View file

@ -405,6 +405,12 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
sbufWriteU32(dst, featureMask());
break;
#ifdef BEEPER
case MSP_BEEPER_CONFIG:
sbufWriteU32(dst, getBeeperOffMask());
break;
#endif
case MSP_BATTERY_STATE: {
// battery characteristics
sbufWriteU8(dst, (uint8_t)constrain(getBatteryCellCount(), 0, 255)); // 0 indicates battery not detected.
@ -1653,6 +1659,13 @@ static mspResult_e mspFcProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
featureSet(sbufReadU32(src)); // features bitmap
break;
#ifdef BEEPER
case MSP_SET_BEEPER_CONFIG:
beeperOffClearAll();
setBeeperOffMask(sbufReadU32(src));
break;
#endif
case MSP_SET_BOARD_ALIGNMENT_CONFIG:
boardAlignmentMutable()->rollDegrees = sbufReadU16(src);
boardAlignmentMutable()->pitchDegrees = sbufReadU16(src);

View file

@ -214,6 +214,9 @@
#define MSP_CAMERA_CONTROL 98
#define MSP_BEEPER_CONFIG 99
#define MSP_SET_BEEPER_CONFIG 100
//
// OSD specific
//