Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy hdzero special case #10540

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions src/main/io/displayport_msp_osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,31 +133,6 @@ static int output(displayPort_t *displayPort, uint8_t cmd, uint8_t *subcmd, int
return sent;
}

static uint8_t determineHDZeroOsdMode(void)
{
if (cmsInMenu) {
return HD_5018;
}

// Check if all visible widgets are in the center 30x16 chars of the canvas.
int activeLayout = osdGetActiveLayout(NULL);
osd_items_e index = 0;
do {
index = osdIncElementIndex(index);
uint16_t pos = osdLayoutsConfig()->item_pos[activeLayout][index];
if (OSD_VISIBLE(pos)) {
uint8_t elemPosX = OSD_X(pos);
uint8_t elemPosY = OSD_Y(pos);
if (!osdItemIsFixed(index) && (elemPosX < 10 || elemPosX > 39 || elemPosY == 0 || elemPosY == 17)) {
return HD_5018;
}
}
} while (index > 0);

return HD_3016;
}


uint8_t setAttrPage(uint8_t origAttr, uint8_t page)
{
return (origAttr & ~DISPLAYPORT_MSP_ATTR_FONTPAGE_MASK) | (page & DISPLAYPORT_MSP_ATTR_FONTPAGE_MASK);
Expand All @@ -175,10 +150,6 @@ uint8_t setAttrVersion(uint8_t origAttr, uint8_t version)

static int setDisplayMode(displayPort_t *displayPort)
{
if (osdVideoSystem == VIDEO_SYSTEM_HDZERO) {
currentOsdMode = determineHDZeroOsdMode(); // Can change between layouts
}

uint8_t subcmd[] = { MSP_DP_OPTIONS, 0, currentOsdMode }; // Font selection, mode (SD/HD)
return output(displayPort, MSP_DISPLAYPORT, subcmd, sizeof(subcmd));
}
Expand Down
Loading