mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
begin-end to open-close
This commit is contained in:
parent
fc81bc668b
commit
d1aa8a603c
3 changed files with 11 additions and 13 deletions
|
@ -35,15 +35,15 @@ void displayClear(displayPort_t *instance)
|
|||
instance->lastCursorPos = -1;
|
||||
}
|
||||
|
||||
void displayBegin(displayPort_t *instance)
|
||||
void displayOpen(displayPort_t *instance)
|
||||
{
|
||||
instance->vTable->begin(instance);
|
||||
instance->vTable->open(instance);
|
||||
instance->vTable->clear(instance);
|
||||
}
|
||||
|
||||
void displayEnd(displayPort_t *instance)
|
||||
void displayClose(displayPort_t *instance)
|
||||
{
|
||||
instance->vTable->end(instance);
|
||||
instance->vTable->close(instance);
|
||||
}
|
||||
|
||||
int displayWrite(displayPort_t *instance, uint8_t x, uint8_t y, char *s)
|
||||
|
|
|
@ -22,8 +22,6 @@ typedef struct displayPort_s {
|
|||
const struct displayPortVTable_s *vTable;
|
||||
uint8_t rows;
|
||||
uint8_t cols;
|
||||
uint16_t buftime;
|
||||
uint16_t bufsize;
|
||||
|
||||
// CMS state
|
||||
bool cleared;
|
||||
|
@ -31,8 +29,8 @@ typedef struct displayPort_s {
|
|||
} displayPort_t;
|
||||
|
||||
typedef struct displayPortVTable_s {
|
||||
int (*begin)(displayPort_t *displayPort);
|
||||
int (*end)(displayPort_t *displayPort);
|
||||
int (*open)(displayPort_t *displayPort);
|
||||
int (*close)(displayPort_t *displayPort);
|
||||
int (*clear)(displayPort_t *displayPort);
|
||||
int (*write)(displayPort_t *displayPort, uint8_t col, uint8_t row, char *text);
|
||||
int (*heartbeat)(displayPort_t *displayPort);
|
||||
|
@ -40,9 +38,9 @@ typedef struct displayPortVTable_s {
|
|||
uint32_t (*txBytesFree)(displayPort_t *displayPort);
|
||||
} displayPortVTable_t;
|
||||
|
||||
void displayOpen(displayPort_t *instance);
|
||||
void displayClose(displayPort_t *instance);
|
||||
void displayClear(displayPort_t *instance);
|
||||
void displayBegin(displayPort_t *instance);
|
||||
void displayEnd(displayPort_t *instance);
|
||||
int displayWrite(displayPort_t *instance, uint8_t x, uint8_t y, char *s);
|
||||
void displayHeartbeat(displayPort_t *instance);
|
||||
void displayResync(displayPort_t *instance);
|
||||
|
|
|
@ -494,7 +494,7 @@ void cmsMenuOpen(void)
|
|||
currentMenu = &menuMain[0];
|
||||
} else {
|
||||
// Switch display
|
||||
displayEnd(¤tDisplay);
|
||||
displayClose(¤tDisplay);
|
||||
initfunc = cmsDeviceSelectNext();
|
||||
}
|
||||
|
||||
|
@ -502,7 +502,7 @@ void cmsMenuOpen(void)
|
|||
return;
|
||||
|
||||
cmsScreenInit(¤tDisplay, initfunc);
|
||||
displayBegin(¤tDisplay);
|
||||
displayOpen(¤tDisplay);
|
||||
cmsMenuChange(¤tDisplay, currentMenu);
|
||||
}
|
||||
|
||||
|
@ -524,7 +524,7 @@ long cmsMenuExit(displayPort_t *pDisplay, void *ptr)
|
|||
|
||||
cmsInMenu = false;
|
||||
|
||||
displayEnd(pDisplay);
|
||||
displayClose(pDisplay);
|
||||
currentMenu = NULL;
|
||||
|
||||
if (ptr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue