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

Fix reset PG behaviour and configurator interactions based on USE_OSD_SD and USE_OSD_HD definitions (#12152)

This commit is contained in:
Steve Evans 2023-01-08 09:49:28 +00:00 committed by GitHub
parent a3a21d9233
commit 107d577a90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 89 additions and 50 deletions

View file

@ -165,20 +165,14 @@ static bool isSynced(const displayPort_t *displayPort)
static void redraw(displayPort_t *displayPort)
{
#ifdef USE_OSD
if (vcdProfile()->video_system == VIDEO_SYSTEM_HD) {
displayPort->rows = osdConfig()->canvas_rows;
displayPort->cols = osdConfig()->canvas_cols;
} else {
const uint8_t displayRows = (vcdProfile()->video_system == VIDEO_SYSTEM_PAL) ? 16 : 13;
const uint8_t displayRows = (vcdProfile()->video_system == VIDEO_SYSTEM_PAL) ? VIDEO_LINES_PAL : VIDEO_LINES_NTSC;
displayPort->rows = displayRows + displayPortProfileMsp()->rowAdjust;
displayPort->cols = 30 + displayPortProfileMsp()->colAdjust;
displayPort->cols = OSD_SD_COLS + displayPortProfileMsp()->colAdjust;
}
#else
const uint8_t displayRows = (vcdProfile()->video_system == VIDEO_SYSTEM_PAL) ? 16 : 13;
displayPort->rows = displayRows + displayPortProfileMsp()->rowAdjust;
displayPort->cols = 30 + displayPortProfileMsp()->colAdjust;
#endif // USE_OSD
drawScreen(displayPort);
}
@ -215,6 +209,17 @@ displayPort_t *displayPortMspInit(void)
mspDisplayPort.useDeviceBlink = true;
}
#ifndef USE_OSD_SD
if (vcdProfile()->video_system != VIDEO_SYSTEM_HD) {
vcdProfileMutable()->video_system = VIDEO_SYSTEM_HD;
}
#endif
#ifndef USE_OSD_HD
if (vcdProfile()->video_system == VIDEO_SYSTEM_HD) {
vcdProfileMutable()->video_system = VIDEO_SYSTEM_AUTO;
}
#endif
redraw(&mspDisplayPort);
return &mspDisplayPort;
}