1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 00:05:28 +03:00

Have you ever wish INAV had a mute switch?

Add a mode to silence all the beeping.

Ideal for those bench sessions where your gps or some other piece of INAV
is causing it to beep all the time.
This commit is contained in:
Marcelo Bezerra 2023-04-16 21:14:33 +02:00
parent 6f556e1e81
commit e5720f1f99
3 changed files with 4 additions and 1 deletions

View file

@ -97,6 +97,7 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT + 1] = {
{ .boxId = BOXPLANWPMISSION, .boxName = "WP PLANNER", .permanentId = 55 },
{ .boxId = BOXSOARING, .boxName = "SOARING", .permanentId = 56 },
{ .boxId = BOXCHANGEMISSION, .boxName = "MISSION CHANGE", .permanentId = 59 },
{ .boxId = BOXBEEPERMUTE, .boxName = "BEEPER MUTE", .permanentId = 60 },
{ .boxId = CHECKBOX_ITEM_COUNT, .boxName = NULL, .permanentId = 0xFF }
};
@ -281,6 +282,7 @@ void initActiveBoxIds(void)
}
ADD_ACTIVE_BOX(BOXBEEPERON);
ADD_ACTIVE_BOX(BOXBEEPERMUTE);
#ifdef USE_LIGHTS
ADD_ACTIVE_BOX(BOXLIGHTS);

View file

@ -77,6 +77,7 @@ typedef enum {
BOXUSER3 = 48,
BOXUSER4 = 49,
BOXCHANGEMISSION = 50,
BOXBEEPERMUTE = 51,
CHECKBOX_ITEM_COUNT
} boxId_e;

View file

@ -218,7 +218,7 @@ static const beeperTableEntry_t *currentBeeperEntry = NULL;
*/
void beeper(beeperMode_e mode)
{
if (mode == BEEPER_SILENCE || ((getBeeperOffMask() & (1 << (BEEPER_USB-1))) && (feature(FEATURE_VBAT) && (getBatteryCellCount() < 2)))) {
if (mode == BEEPER_SILENCE || ((getBeeperOffMask() & (1 << (BEEPER_USB-1))) && (feature(FEATURE_VBAT) && (getBatteryCellCount() < 2))) || IS_RC_MODE_ACTIVE(BOXBEEPERMUTE)) {
beeperSilence();
return;
}