Merge pull request #11538 from klutvott123/osd-visual-beeper
Fix OSD visual beeper
This commit is contained in:
commit
987fba3463
|
@ -47,6 +47,10 @@
|
|||
#include "io/gps.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_OSD
|
||||
#include "osd/osd.h"
|
||||
#endif
|
||||
|
||||
#include "pg/beeper.h"
|
||||
|
||||
#include "scheduler/scheduler.h"
|
||||
|
@ -435,6 +439,14 @@ void beeperUpdate(timeUs_t currentTimeUs)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(USE_OSD)
|
||||
static bool beeperWasOn = false;
|
||||
if (beeperIsOn && !beeperWasOn) {
|
||||
osdSetVisualBeeperState(true);
|
||||
}
|
||||
beeperWasOn = beeperIsOn;
|
||||
#endif
|
||||
|
||||
beeperProcessCommand(currentTimeUs);
|
||||
}
|
||||
|
||||
|
|
|
@ -1205,8 +1205,6 @@ void osdUpdate(timeUs_t currentTimeUs)
|
|||
break;
|
||||
|
||||
case OSD_STATE_CHECK:
|
||||
showVisualBeeper = isBeeperOn();
|
||||
|
||||
// don't touch buffers if DMA transaction is in progress
|
||||
if (displayIsTransferInProgress(osdDisplayPort)) {
|
||||
break;
|
||||
|
@ -1474,6 +1472,11 @@ bool osdGetVisualBeeperState(void)
|
|||
return showVisualBeeper;
|
||||
}
|
||||
|
||||
void osdSetVisualBeeperState(bool state)
|
||||
{
|
||||
showVisualBeeper = state;
|
||||
}
|
||||
|
||||
statistic_t *osdGetStats(void)
|
||||
{
|
||||
return &stats;
|
||||
|
|
|
@ -354,6 +354,7 @@ void osdWarnSetState(uint8_t warningIndex, bool enabled);
|
|||
bool osdWarnGetState(uint8_t warningIndex);
|
||||
bool osdElementVisible(uint16_t value);
|
||||
bool osdGetVisualBeeperState(void);
|
||||
void osdSetVisualBeeperState(bool state);
|
||||
statistic_t *osdGetStats(void);
|
||||
bool osdNeedsAccelerometer(void);
|
||||
int osdPrintFloat(char *buffer, char leadingSymbol, float value, char *formatString, unsigned decimalPlaces, bool round, char trailingSymbol);
|
||||
|
|
|
@ -331,6 +331,7 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr)
|
|||
if (osdWarnGetState(OSD_WARNING_VISUAL_BEEPER) && osdGetVisualBeeperState()) {
|
||||
tfp_sprintf(warningText, " * * * *");
|
||||
*displayAttr = DISPLAYPORT_ATTR_INFO;
|
||||
osdSetVisualBeeperState(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue