mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
"Fullscreen" mode for displayports.
This commit is contained in:
parent
c7b2260645
commit
dd30009925
4 changed files with 12 additions and 15 deletions
|
@ -725,6 +725,13 @@ void cmsMenuOpen(void)
|
||||||
maxMenuItems = pCurrentDisplay->rows - 2;
|
maxMenuItems = pCurrentDisplay->rows - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pCurrentDisplay->useFullscreen)
|
||||||
|
{
|
||||||
|
leftMenuColumn = 0;
|
||||||
|
rightMenuColumn = pCurrentDisplay->cols;
|
||||||
|
maxMenuItems = pCurrentDisplay->rows;
|
||||||
|
}
|
||||||
|
|
||||||
cmsMenuChange(pCurrentDisplay, currentCtx.menu);
|
cmsMenuChange(pCurrentDisplay, currentCtx.menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,7 @@ void displayInit(displayPort_t *instance, const displayPortVTable_t *vTable)
|
||||||
{
|
{
|
||||||
instance->vTable = vTable;
|
instance->vTable = vTable;
|
||||||
instance->vTable->clearScreen(instance);
|
instance->vTable->clearScreen(instance);
|
||||||
|
instance->useFullscreen = false;
|
||||||
instance->cleared = true;
|
instance->cleared = true;
|
||||||
instance->grabCount = 0;
|
instance->grabCount = 0;
|
||||||
instance->cursorRow = -1;
|
instance->cursorRow = -1;
|
||||||
|
|
|
@ -31,6 +31,7 @@ typedef struct displayPort_s {
|
||||||
uint8_t posY;
|
uint8_t posY;
|
||||||
|
|
||||||
// CMS state
|
// CMS state
|
||||||
|
bool useFullscreen;
|
||||||
bool cleared;
|
bool cleared;
|
||||||
int8_t cursorRow;
|
int8_t cursorRow;
|
||||||
int8_t grabCount;
|
int8_t grabCount;
|
||||||
|
|
|
@ -22,12 +22,6 @@
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#if defined (USE_HOTT_TEXTMODE) && defined (USE_CMS)
|
#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 "common/utils.h"
|
||||||
#include "cms/cms.h"
|
#include "cms/cms.h"
|
||||||
#include "telemetry/hott.h"
|
#include "telemetry/hott.h"
|
||||||
|
@ -49,13 +43,6 @@ static int hottWriteChar(displayPort_t *displayPort, uint8_t col, uint8_t row, u
|
||||||
{
|
{
|
||||||
UNUSED(displayPort);
|
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);
|
hottTextmodeWriteChar(col, row, c);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -136,8 +123,9 @@ displayPort_t *displayPortHottInit()
|
||||||
{
|
{
|
||||||
hottDisplayPort.device = NULL;
|
hottDisplayPort.device = NULL;
|
||||||
displayInit(&hottDisplayPort, &hottVTable);
|
displayInit(&hottDisplayPort, &hottVTable);
|
||||||
hottDisplayPort.rows = HOTT_TEXTMODE_DISPLAY_ROWS + ROW_CORRECTION * 2;
|
hottDisplayPort.useFullscreen = true;
|
||||||
hottDisplayPort.cols = HOTT_TEXTMODE_DISPLAY_COLUMNS + COL_CORRECTION * 2;
|
hottDisplayPort.rows = HOTT_TEXTMODE_DISPLAY_ROWS;
|
||||||
|
hottDisplayPort.cols = HOTT_TEXTMODE_DISPLAY_COLUMNS;
|
||||||
return &hottDisplayPort;
|
return &hottDisplayPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue