mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 04:15:44 +03:00
Add support for character attribute rich displayport
This commit is contained in:
parent
e1244af09a
commit
2e84b0c442
17 changed files with 123 additions and 70 deletions
|
@ -361,7 +361,7 @@ static int cmsDrawMenuItemValue(displayPort_t *pDisplay, char *buff, uint8_t row
|
|||
#else
|
||||
colpos = smallScreen ? rightMenuColumn - maxSize : rightMenuColumn;
|
||||
#endif
|
||||
cnt = displayWrite(pDisplay, colpos, row, buff);
|
||||
cnt = displayWrite(pDisplay, colpos, row, DISPLAYPORT_ATTR_NONE, buff);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
@ -510,7 +510,7 @@ static int cmsDrawMenuEntry(displayPort_t *pDisplay, const OSD_Entry *p, uint8_t
|
|||
case OME_Label:
|
||||
if (IS_PRINTVALUE(*flags) && p->data) {
|
||||
// A label with optional string, immediately following text
|
||||
cnt = displayWrite(pDisplay, leftMenuColumn + 1 + (uint8_t)strlen(p->text), row, p->data);
|
||||
cnt = displayWrite(pDisplay, leftMenuColumn + 1 + (uint8_t)strlen(p->text), row, DISPLAYPORT_ATTR_NONE, p->data);
|
||||
CLR_PRINTVALUE(*flags);
|
||||
}
|
||||
break;
|
||||
|
@ -526,9 +526,9 @@ static int cmsDrawMenuEntry(displayPort_t *pDisplay, const OSD_Entry *p, uint8_t
|
|||
#ifdef CMS_MENU_DEBUG
|
||||
// Shouldn't happen. Notify creator of this menu content
|
||||
#ifdef CMS_OSD_RIGHT_ALIGNED_VALUES
|
||||
cnt = displayWrite(pDisplay, rightMenuColumn - 6, row, "BADENT");
|
||||
cnt = displayWrite(pDisplay, rightMenuColumn - 6, row, DISPLAYPORT_ATTR_NONE, "BADENT");
|
||||
#else
|
||||
cnt = displayWrite(pDisplay, rightMenuColumn, row, "BADENT");
|
||||
cnt = displayWrite(pDisplay, rightMenuColumn, row, DISPLAYPORT_ATTR_NONE, "BADENT");
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
|
@ -582,7 +582,7 @@ static void cmsDrawMenu(displayPort_t *pDisplay, uint32_t currentTimeUs)
|
|||
cmsPageDebug();
|
||||
|
||||
if (pDisplay->cursorRow >= 0 && currentCtx.cursorRow != pDisplay->cursorRow) {
|
||||
room -= displayWrite(pDisplay, leftMenuColumn, top + pDisplay->cursorRow * linesPerMenuItem, " ");
|
||||
room -= displayWrite(pDisplay, leftMenuColumn, top + pDisplay->cursorRow * linesPerMenuItem, DISPLAYPORT_ATTR_NONE, " ");
|
||||
}
|
||||
|
||||
if (room < 30) {
|
||||
|
@ -590,7 +590,7 @@ static void cmsDrawMenu(displayPort_t *pDisplay, uint32_t currentTimeUs)
|
|||
}
|
||||
|
||||
if (pDisplay->cursorRow != currentCtx.cursorRow) {
|
||||
room -= displayWrite(pDisplay, leftMenuColumn, top + currentCtx.cursorRow * linesPerMenuItem, ">");
|
||||
room -= displayWrite(pDisplay, leftMenuColumn, top + currentCtx.cursorRow * linesPerMenuItem, DISPLAYPORT_ATTR_NONE, ">");
|
||||
pDisplay->cursorRow = currentCtx.cursorRow;
|
||||
}
|
||||
|
||||
|
@ -612,7 +612,7 @@ static void cmsDrawMenu(displayPort_t *pDisplay, uint32_t currentTimeUs)
|
|||
if (IS_PRINTLABEL(runtimeEntryFlags[i])) {
|
||||
uint8_t coloff = leftMenuColumn;
|
||||
coloff += (p->type == OME_Label) ? 0 : 1;
|
||||
room -= displayWrite(pDisplay, coloff, top + i * linesPerMenuItem, p->text);
|
||||
room -= displayWrite(pDisplay, coloff, top + i * linesPerMenuItem, DISPLAYPORT_ATTR_NONE, p->text);
|
||||
CLR_PRINTLABEL(runtimeEntryFlags[i]);
|
||||
if (room < 30) {
|
||||
return;
|
||||
|
@ -832,7 +832,7 @@ long cmsMenuExit(displayPort_t *pDisplay, const void *ptr)
|
|||
|
||||
if ((exitType == CMS_EXIT_SAVEREBOOT) || (exitType == CMS_POPUP_SAVEREBOOT) || (exitType == CMS_POPUP_EXITREBOOT)) {
|
||||
displayClearScreen(pDisplay);
|
||||
displayWrite(pDisplay, 5, 3, "REBOOTING...");
|
||||
displayWrite(pDisplay, 5, 3, DISPLAYPORT_ATTR_NONE, "REBOOTING...");
|
||||
|
||||
displayResync(pDisplay); // Was max7456RefreshAll(); why at this timing?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue