From f100947975873361eb4eecd4a0a3678ea4ffb513 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:28:16 +0100 Subject: [PATCH] VIDEO_SYSTEM_AUTO will negotiate canvas size --- src/main/fc/fc_msp.c | 18 ++++++++++-------- src/main/io/displayport_msp_osd.c | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/fc/fc_msp.c b/src/main/fc/fc_msp.c index 22234525e55..ec1f2fa004f 100644 --- a/src/main/fc/fc_msp.c +++ b/src/main/fc/fc_msp.c @@ -2060,14 +2060,16 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src) #ifdef USE_MSP_DISPLAYPORT case MSP_SET_OSD_CANVAS: { - displayPort_t *dp = osdGetDisplayPort(); - if(dp != NULL && dataSize == 2) { - dp->cols = constrain(sbufReadU8(src), 30, MSP_DISPLAYPORT_MAX_COLS); - dp->rows = constrain(sbufReadU8(src), 16, MSP_DISPLAYPORT_MAX_ROWS); - } else { - return MSP_RESULT_ERROR; - } - } + if (osdConfig()->video_system == VIDEO_SYSTEM_AUTO) { + displayPort_t *dp = osdGetDisplayPort(); + if (dp != NULL && dataSize == 2) { + dp->cols = constrain(sbufReadU8(src), 30, MSP_DISPLAYPORT_MAX_COLS); + dp->rows = constrain(sbufReadU8(src), 16, MSP_DISPLAYPORT_MAX_ROWS); + } else { + return MSP_RESULT_ERROR; + } + } + } break; #endif diff --git a/src/main/io/displayport_msp_osd.c b/src/main/io/displayport_msp_osd.c index ed17ebfa067..10c9ccd5c74 100644 --- a/src/main/io/displayport_msp_osd.c +++ b/src/main/io/displayport_msp_osd.c @@ -444,7 +444,6 @@ displayPort_t* mspOsdDisplayPortInit(const videoSystem_e videoSystem) { if (mspOsdSerialInit()) { switch(videoSystem) { - case VIDEO_SYSTEM_AUTO: case VIDEO_SYSTEM_DJICOMPAT: case VIDEO_SYSTEM_PAL: currentOsdMode = SD_3016; @@ -461,6 +460,7 @@ displayPort_t* mspOsdDisplayPortInit(const videoSystem_e videoSystem) screenRows = HDZERO_ROWS; screenCols = HDZERO_COLS; break; + case VIDEO_SYSTEM_AUTO: case VIDEO_SYSTEM_DJIWTF: currentOsdMode = HD_6022; screenRows = DJI_ROWS;