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:
parent
7dd0f60544
commit
1e3fcbfcee
7 changed files with 54 additions and 11 deletions
|
@ -512,6 +512,14 @@ void osdInit(displayPort_t *osdDisplayPortToUse, osdDisplayPortDevice_e displayP
|
|||
#endif
|
||||
|
||||
if (osdDisplayPort->cols && osdDisplayPort->rows) {
|
||||
// Ensure that osd_canvas_width/height are correct
|
||||
if (osdConfig()->canvas_cols != osdDisplayPort->cols) {
|
||||
osdConfigMutable()->canvas_cols = osdDisplayPort->cols;
|
||||
}
|
||||
if (osdConfig()->canvas_rows != osdDisplayPort->rows) {
|
||||
osdConfigMutable()->canvas_rows = osdDisplayPort->rows;
|
||||
}
|
||||
|
||||
// Ensure that all OSD elements are on the canvas once number of row/columns is known
|
||||
for (int i = 0; i < OSD_ITEM_COUNT; i++) {
|
||||
uint16_t itemPos = osdElementConfig()->item_pos[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue