mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Cleanups
This commit is contained in:
parent
042096fbb7
commit
f58f7f65b1
12 changed files with 94 additions and 91 deletions
|
@ -1,40 +1,41 @@
|
|||
#pragma once
|
||||
|
||||
typedef struct screenFnVTable_s {
|
||||
struct displayPort_s;
|
||||
|
||||
typedef struct displayPortVTable_s {
|
||||
int (*begin)(void);
|
||||
int (*end)(void);
|
||||
int (*clear)(void);
|
||||
int (*write)(uint8_t, uint8_t, char *);
|
||||
int (*write)(uint8_t col, uint8_t row, char *text);
|
||||
int (*heartbeat)(void);
|
||||
void (*resync)(void);
|
||||
uint16_t (*txroom)(void);
|
||||
} screenFnVTable_t;
|
||||
void (*resync)(struct displayPort_s *pPort);
|
||||
uint32_t (*txroom)(void);
|
||||
} displayPortVTable_t;
|
||||
|
||||
typedef struct displayPort_s {
|
||||
displayPortVTable_t *vTable;
|
||||
uint8_t rows;
|
||||
uint8_t cols;
|
||||
uint16_t buftime;
|
||||
uint16_t bufsize;
|
||||
screenFnVTable_t *vTable;
|
||||
|
||||
// CMS state
|
||||
bool cleared;
|
||||
} displayPort_t;
|
||||
|
||||
// Device management
|
||||
typedef void (*cmsDeviceInitFuncPtr)(displayPort_t *);
|
||||
typedef void (*cmsDeviceInitFuncPtr)(displayPort_t *pPort);
|
||||
bool cmsDeviceRegister(cmsDeviceInitFuncPtr);
|
||||
|
||||
// For main.c and scheduler
|
||||
void cmsInit(void);
|
||||
void cmsHandler(uint32_t);
|
||||
void cmsHandler(uint32_t currentTime);
|
||||
|
||||
// Required for external CMS tables
|
||||
|
||||
long cmsChangeScreen(displayPort_t *, void *);
|
||||
long cmsExitMenu(displayPort_t *, void *);
|
||||
|
||||
#define STARTUP_HELP_TEXT1 "MENU: THR MID"
|
||||
#define STARTUP_HELP_TEXT2 "+ YAW LEFT"
|
||||
#define STARTUP_HELP_TEXT3 "+ PITCH UP"
|
||||
long cmsChangeScreen(displayPort_t *pPort, void *ptr);
|
||||
long cmsExitMenu(displayPort_t *pPort, void *ptr);
|
||||
|
||||
#define CMS_STARTUP_HELP_TEXT1 "MENU: THR MID"
|
||||
#define CMS_STARTUP_HELP_TEXT2 "+ YAW LEFT"
|
||||
#define CMS_STARTUP_HELP_TEXT3 "+ PITCH UP"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue