Skip to content

Commit

Permalink
VIDEO_SYSTEM_AUTO will negotiate canvas size
Browse files Browse the repository at this point in the history
  • Loading branch information
mmosca committed Nov 14, 2024
1 parent b5242b7 commit f100947
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/main/fc/fc_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/main/io/displayport_msp_osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit f100947

Please sign in to comment.