1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Add osd_canvas_width/height variables (#12164)

This commit is contained in:
Steve Evans 2023-01-10 02:25:22 +00:00 committed by GitHub
parent 7dd0f60544
commit 1e3fcbfcee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 11 deletions

View file

@ -165,14 +165,6 @@ static bool isSynced(const displayPort_t *displayPort)
static void redraw(displayPort_t *displayPort)
{
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) ? VIDEO_LINES_PAL : VIDEO_LINES_NTSC;
displayPort->rows = displayRows + displayPortProfileMsp()->rowAdjust;
displayPort->cols = OSD_SD_COLS + displayPortProfileMsp()->colAdjust;
}
drawScreen(displayPort);
}
@ -220,7 +212,17 @@ displayPort_t *displayPortMspInit(void)
}
#endif
if (vcdProfile()->video_system == VIDEO_SYSTEM_HD) {
mspDisplayPort.rows = osdConfig()->canvas_rows;
mspDisplayPort.cols = osdConfig()->canvas_cols;
} else {
const uint8_t displayRows = (vcdProfile()->video_system == VIDEO_SYSTEM_PAL) ? VIDEO_LINES_PAL : VIDEO_LINES_NTSC;
mspDisplayPort.rows = displayRows + displayPortProfileMsp()->rowAdjust;
mspDisplayPort.cols = OSD_SD_COLS + displayPortProfileMsp()->colAdjust;
}
redraw(&mspDisplayPort);
return &mspDisplayPort;
}