mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Fix OSD "DISARMED" blanking the display when armed (#5384)
Changed the logic so that if currently armed and the previous arming state was disarmed, then blank out the message for just this single iteration. This should allow any elements behind to be properly displayed when armed.
This commit is contained in:
parent
2abcaebd81
commit
35f5e5025f
1 changed files with 6 additions and 2 deletions
|
@ -134,6 +134,7 @@ timeUs_t resumeRefreshAt = 0;
|
|||
#define REFRESH_1S 1000 * 1000
|
||||
|
||||
static uint8_t armState;
|
||||
static bool lastArmState;
|
||||
|
||||
static displayPort_t *osdDisplayPort;
|
||||
|
||||
|
@ -387,7 +388,7 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
|
||||
uint8_t elemPosX = OSD_X(osdConfig()->item_pos[item]);
|
||||
uint8_t elemPosY = OSD_Y(osdConfig()->item_pos[item]);
|
||||
char buff[OSD_ELEMENT_BUFFER_LENGTH];
|
||||
char buff[OSD_ELEMENT_BUFFER_LENGTH] = "";
|
||||
|
||||
switch (item) {
|
||||
case OSD_RSSI_VALUE:
|
||||
|
@ -724,7 +725,9 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
if (!ARMING_FLAG(ARMED)) {
|
||||
tfp_sprintf(buff, "DISARMED");
|
||||
} else {
|
||||
tfp_sprintf(buff, " ");
|
||||
if (!lastArmState) { // previously disarmed - blank out the message one time
|
||||
tfp_sprintf(buff, " ");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1291,6 +1294,7 @@ STATIC_UNIT_TESTED void osdRefresh(timeUs_t currentTimeUs)
|
|||
#endif
|
||||
}
|
||||
#endif
|
||||
lastArmState = ARMING_FLAG(ARMED);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue