mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Display one of four logos on arming (#13057)
This commit is contained in:
parent
076049ed7e
commit
e55918c0e0
3 changed files with 7 additions and 4 deletions
|
@ -1380,6 +1380,7 @@ const clivalue_t valueTable[] = {
|
|||
{ "osd_ah_invert", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, ahInvert) },
|
||||
{ "osd_logo_on_arming", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OSD_LOGO_ON_ARMING }, PG_OSD_CONFIG, offsetof(osdConfig_t, logo_on_arming) },
|
||||
{ "osd_logo_on_arming_duration",VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 5, 50 }, PG_OSD_CONFIG, offsetof(osdConfig_t, logo_on_arming_duration) },
|
||||
{ "osd_arming_logo", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 0, DISPLAYPORT_SEVERITY_COUNT - 1 }, PG_OSD_CONFIG, offsetof(osdConfig_t, arming_logo) },
|
||||
#ifdef USE_OSD_QUICK_MENU
|
||||
{ "osd_use_quick_menu", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, osd_use_quick_menu) },
|
||||
#endif // USE_OSD_QUICK_MENU
|
||||
|
|
|
@ -464,14 +464,14 @@ void pgResetFn_osdElementConfig(osdElementConfig_t *osdElementConfig)
|
|||
osdElementConfig->item_pos[OSD_UP_DOWN_REFERENCE] = OSD_POS((midCol - 2), (midRow - 1));
|
||||
}
|
||||
|
||||
static void osdDrawLogo(int x, int y)
|
||||
static void osdDrawLogo(int x, int y, displayPortSeverity_e fontSel)
|
||||
{
|
||||
// display logo and help
|
||||
int fontOffset = 160;
|
||||
for (int row = 0; row < OSD_LOGO_ROWS; row++) {
|
||||
for (int column = 0; column < OSD_LOGO_COLS; column++) {
|
||||
if (fontOffset <= SYM_END_OF_FONT)
|
||||
displayWriteChar(osdDisplayPort, x + column, y + row, DISPLAYPORT_SEVERITY_NORMAL, fontOffset++);
|
||||
displayWriteChar(osdDisplayPort, x + column, y + row, fontSel, fontOffset++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -491,7 +491,8 @@ static void osdCompleteInitialization(void)
|
|||
displayBeginTransaction(osdDisplayPort, DISPLAY_TRANSACTION_OPT_RESET_DRAWING);
|
||||
displayClearScreen(osdDisplayPort, DISPLAY_CLEAR_WAIT);
|
||||
|
||||
osdDrawLogo(midCol - (OSD_LOGO_COLS) / 2, midRow - 5);
|
||||
// Display betaflight logo
|
||||
osdDrawLogo(midCol - (OSD_LOGO_COLS) / 2, midRow - 5, DISPLAYPORT_SEVERITY_NORMAL);
|
||||
|
||||
char string_buffer[30];
|
||||
tfp_sprintf(string_buffer, "V%s", FC_VERSION_STRING);
|
||||
|
@ -1194,7 +1195,7 @@ static timeDelta_t osdShowArmed(void)
|
|||
if ((osdConfig()->logo_on_arming == OSD_LOGO_ARMING_ON) || ((osdConfig()->logo_on_arming == OSD_LOGO_ARMING_FIRST) && !ARMING_FLAG(WAS_EVER_ARMED))) {
|
||||
uint8_t midRow = osdDisplayPort->rows / 2;
|
||||
uint8_t midCol = osdDisplayPort->cols / 2;
|
||||
osdDrawLogo(midCol - (OSD_LOGO_COLS) / 2, midRow - 5);
|
||||
osdDrawLogo(midCol - (OSD_LOGO_COLS) / 2, midRow - 5, osdConfig()->arming_logo);
|
||||
ret = osdConfig()->logo_on_arming_duration * 1e5;
|
||||
} else {
|
||||
ret = (REFRESH_1S / 2);
|
||||
|
|
|
@ -355,6 +355,7 @@ typedef struct osdConfig_s {
|
|||
#ifdef USE_SPEC_PREARM_SCREEN
|
||||
uint8_t osd_show_spec_prearm;
|
||||
#endif // USE_SPEC_PREARM_SCREEN
|
||||
displayPortSeverity_e arming_logo; // font from which to display logo on arming
|
||||
} osdConfig_t;
|
||||
|
||||
PG_DECLARE(osdConfig_t, osdConfig);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue