"Fullscreen" mode for displayports.
This commit is contained in:
parent
c7b2260645
commit
dd30009925
|
@ -725,6 +725,13 @@ void cmsMenuOpen(void)
|
|||
maxMenuItems = pCurrentDisplay->rows - 2;
|
||||
}
|
||||
|
||||
if (pCurrentDisplay->useFullscreen)
|
||||
{
|
||||
leftMenuColumn = 0;
|
||||
rightMenuColumn = pCurrentDisplay->cols;
|
||||
maxMenuItems = pCurrentDisplay->rows;
|
||||
}
|
||||
|
||||
cmsMenuChange(pCurrentDisplay, currentCtx.menu);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ void displayInit(displayPort_t *instance, const displayPortVTable_t *vTable)
|
|||
{
|
||||
instance->vTable = vTable;
|
||||
instance->vTable->clearScreen(instance);
|
||||
instance->useFullscreen = false;
|
||||
instance->cleared = true;
|
||||
instance->grabCount = 0;
|
||||
instance->cursorRow = -1;
|
||||
|
|
|
@ -31,6 +31,7 @@ typedef struct displayPort_s {
|
|||
uint8_t posY;
|
||||
|
||||
// CMS state
|
||||
bool useFullscreen;
|
||||
bool cleared;
|
||||
int8_t cursorRow;
|
||||
int8_t grabCount;
|
||||
|
|
|
@ -22,12 +22,6 @@
|
|||
#include "platform.h"
|
||||
#if defined (USE_HOTT_TEXTMODE) && defined (USE_CMS)
|
||||
|
||||
// Fixme:
|
||||
// Let the CMS believe we have a bigger display to avoid empty rows and columns
|
||||
// Better make this configurable in CMS
|
||||
#define ROW_CORRECTION 1
|
||||
#define COL_CORRECTION 2
|
||||
|
||||
#include "common/utils.h"
|
||||
#include "cms/cms.h"
|
||||
#include "telemetry/hott.h"
|
||||
|
@ -49,13 +43,6 @@ static int hottWriteChar(displayPort_t *displayPort, uint8_t col, uint8_t row, u
|
|||
{
|
||||
UNUSED(displayPort);
|
||||
|
||||
if (row < ROW_CORRECTION || row >= HOTT_TEXTMODE_DISPLAY_ROWS + ROW_CORRECTION
|
||||
|| col < COL_CORRECTION || col >= HOTT_TEXTMODE_DISPLAY_COLUMNS + COL_CORRECTION) {
|
||||
return 0;
|
||||
}
|
||||
row -= ROW_CORRECTION;
|
||||
col -= COL_CORRECTION;
|
||||
|
||||
hottTextmodeWriteChar(col, row, c);
|
||||
return 0;
|
||||
}
|
||||
|
@ -136,8 +123,9 @@ displayPort_t *displayPortHottInit()
|
|||
{
|
||||
hottDisplayPort.device = NULL;
|
||||
displayInit(&hottDisplayPort, &hottVTable);
|
||||
hottDisplayPort.rows = HOTT_TEXTMODE_DISPLAY_ROWS + ROW_CORRECTION * 2;
|
||||
hottDisplayPort.cols = HOTT_TEXTMODE_DISPLAY_COLUMNS + COL_CORRECTION * 2;
|
||||
hottDisplayPort.useFullscreen = true;
|
||||
hottDisplayPort.rows = HOTT_TEXTMODE_DISPLAY_ROWS;
|
||||
hottDisplayPort.cols = HOTT_TEXTMODE_DISPLAY_COLUMNS;
|
||||
return &hottDisplayPort;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue