mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Touch-ups, tidy, bandwidth mgmt on serial canvas
This commit is contained in:
parent
c3c13cf454
commit
38660aa8a6
10 changed files with 524 additions and 507 deletions
|
@ -67,9 +67,7 @@
|
||||||
#include "io/flashfs.h"
|
#include "io/flashfs.h"
|
||||||
#include "io/transponder_ir.h"
|
#include "io/transponder_ir.h"
|
||||||
#include "io/asyncfatfs/asyncfatfs.h"
|
#include "io/asyncfatfs/asyncfatfs.h"
|
||||||
//#include "io/osd.h"
|
|
||||||
#include "io/serial_4way.h"
|
#include "io/serial_4way.h"
|
||||||
//#include "io/vtx.h"
|
|
||||||
|
|
||||||
#include "msp/msp.h"
|
#include "msp/msp.h"
|
||||||
#include "msp/msp_protocol.h"
|
#include "msp/msp_protocol.h"
|
||||||
|
|
|
@ -17,45 +17,48 @@
|
||||||
#include "msp/msp_protocol.h"
|
#include "msp/msp_protocol.h"
|
||||||
#include "msp/msp_serial.h"
|
#include "msp/msp_serial.h"
|
||||||
|
|
||||||
void canvasOutput(uint8_t cmd, uint8_t *buf, int len)
|
void canvasGetDevParam(uint8_t *pRows, uint8_t *pCols, uint16_t *pBuftime, uint16_t *pBufsize)
|
||||||
{
|
|
||||||
mspSerialPush(cmd, buf, len);
|
|
||||||
delayMicroseconds(len * 150); // XXX Kludge!!!
|
|
||||||
}
|
|
||||||
|
|
||||||
void canvasGetSize(uint8_t *pRows, uint8_t *pCols)
|
|
||||||
{
|
{
|
||||||
*pRows = 13;
|
*pRows = 13;
|
||||||
*pCols = 30;
|
*pCols = 30;
|
||||||
|
*pBuftime = 23; // = 256/(115200/10)
|
||||||
|
*pBufsize = 192; // 256 * 3/4 (Be conservative)
|
||||||
}
|
}
|
||||||
|
|
||||||
void canvasBegin(void)
|
int canvasOutput(uint8_t cmd, uint8_t *buf, int len)
|
||||||
|
{
|
||||||
|
mspSerialPush(cmd, buf, len);
|
||||||
|
|
||||||
|
return 6 + len;
|
||||||
|
}
|
||||||
|
|
||||||
|
int canvasBegin(void)
|
||||||
{
|
{
|
||||||
uint8_t subcmd[] = { 0 };
|
uint8_t subcmd[] = { 0 };
|
||||||
|
|
||||||
canvasOutput(MSP_CANVAS, subcmd, sizeof(subcmd));
|
return canvasOutput(MSP_CANVAS, subcmd, sizeof(subcmd));
|
||||||
}
|
}
|
||||||
|
|
||||||
void canvasHeartBeat(void)
|
int canvasHeartBeat(void)
|
||||||
{
|
{
|
||||||
canvasBegin();
|
return canvasBegin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void canvasEnd(void)
|
int canvasEnd(void)
|
||||||
{
|
{
|
||||||
uint8_t subcmd[] = { 1 };
|
uint8_t subcmd[] = { 1 };
|
||||||
|
|
||||||
canvasOutput(MSP_CANVAS, subcmd, sizeof(subcmd));
|
return canvasOutput(MSP_CANVAS, subcmd, sizeof(subcmd));
|
||||||
}
|
}
|
||||||
|
|
||||||
void canvasClear(void)
|
int canvasClear(void)
|
||||||
{
|
{
|
||||||
uint8_t subcmd[] = { 2 };
|
uint8_t subcmd[] = { 2 };
|
||||||
|
|
||||||
canvasOutput(MSP_CANVAS, subcmd, sizeof(subcmd));
|
return canvasOutput(MSP_CANVAS, subcmd, sizeof(subcmd));
|
||||||
}
|
}
|
||||||
|
|
||||||
void canvasWrite(uint8_t col, uint8_t row, char *string)
|
int canvasWrite(uint8_t col, uint8_t row, char *string)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
char buf[30 + 4];
|
char buf[30 + 4];
|
||||||
|
@ -69,11 +72,11 @@ void canvasWrite(uint8_t col, uint8_t row, char *string)
|
||||||
buf[3] = 0;
|
buf[3] = 0;
|
||||||
memcpy((char *)&buf[4], string, len);
|
memcpy((char *)&buf[4], string, len);
|
||||||
|
|
||||||
canvasOutput(MSP_CANVAS, (uint8_t *)buf, len + 4);
|
return canvasOutput(MSP_CANVAS, (uint8_t *)buf, len + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
screenFnVTable_t canvasVTable = {
|
screenFnVTable_t canvasVTable = {
|
||||||
canvasGetSize,
|
canvasGetDevParam,
|
||||||
canvasBegin,
|
canvasBegin,
|
||||||
canvasEnd,
|
canvasEnd,
|
||||||
canvasClear,
|
canvasClear,
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -11,3 +11,7 @@ void cmsScreenResync(void);
|
||||||
|
|
||||||
void cmsChangeScreen(void * ptr);
|
void cmsChangeScreen(void * ptr);
|
||||||
void cmsExitMenu(void * ptr);
|
void cmsExitMenu(void * ptr);
|
||||||
|
|
||||||
|
#define STARTUP_HELP_TEXT1 "MENU: THR MID"
|
||||||
|
#define STARTUP_HELP_TEXT2 "+ YAW LEFT"
|
||||||
|
#define STARTUP_HELP_TEXT3 "+ PITCH UP"
|
||||||
|
|
|
@ -23,7 +23,6 @@ typedef enum
|
||||||
OME_FLOAT, //only up to 255 value and cant be 2.55 or 25.5, just for PID's
|
OME_FLOAT, //only up to 255 value and cant be 2.55 or 25.5, just for PID's
|
||||||
//wlasciwosci elementow
|
//wlasciwosci elementow
|
||||||
OME_VISIBLE,
|
OME_VISIBLE,
|
||||||
OME_POS,
|
|
||||||
OME_TAB,
|
OME_TAB,
|
||||||
OME_END,
|
OME_END,
|
||||||
} OSD_MenuElement;
|
} OSD_MenuElement;
|
||||||
|
@ -34,9 +33,21 @@ typedef struct
|
||||||
OSD_MenuElement type;
|
OSD_MenuElement type;
|
||||||
OSDMenuFuncPtr func;
|
OSDMenuFuncPtr func;
|
||||||
void *data;
|
void *data;
|
||||||
bool changed;
|
uint8_t flags;
|
||||||
} OSD_Entry;
|
} OSD_Entry;
|
||||||
|
|
||||||
|
// Bits in flags
|
||||||
|
#define PRINT_VALUE 0x01 // Value has been changed, need to redraw
|
||||||
|
#define PRINT_LABEL 0x02 // Text label should be printed
|
||||||
|
|
||||||
|
#define IS_PRINTVALUE(p) ((p)->flags & PRINT_VALUE)
|
||||||
|
#define SET_PRINTVALUE(p) { (p)->flags |= PRINT_VALUE; }
|
||||||
|
#define CLR_PRINTVALUE(p) { (p)->flags &= ~PRINT_VALUE; }
|
||||||
|
|
||||||
|
#define IS_PRINTLABEL(p) ((p)->flags & PRINT_LABEL)
|
||||||
|
#define SET_PRINTLABEL(p) { (p)->flags |= PRINT_LABEL; }
|
||||||
|
#define CLR_PRINTLABEL(p) { (p)->flags &= ~PRINT_LABEL; }
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8_t *val;
|
uint8_t *val;
|
||||||
|
@ -86,11 +97,11 @@ typedef struct
|
||||||
} OSD_TAB_t;
|
} OSD_TAB_t;
|
||||||
|
|
||||||
typedef struct screenFnVTable_s {
|
typedef struct screenFnVTable_s {
|
||||||
void (*getsize)(uint8_t *, uint8_t *);
|
void (*getDevParam)(uint8_t *, uint8_t *, uint16_t *, uint16_t *);
|
||||||
void (*begin)(void);
|
int (*begin)(void);
|
||||||
void (*end)(void);
|
int (*end)(void);
|
||||||
void (*clear)(void);
|
int (*clear)(void);
|
||||||
void (*write)(uint8_t, uint8_t, char *);
|
int (*write)(uint8_t, uint8_t, char *);
|
||||||
void (*heartbeat)(void);
|
int (*heartbeat)(void);
|
||||||
void (*resync)(void);
|
void (*resync)(void);
|
||||||
} screenFnVTable_t;
|
} screenFnVTable_t;
|
||||||
|
|
|
@ -62,8 +62,6 @@
|
||||||
#include "io/gimbal.h"
|
#include "io/gimbal.h"
|
||||||
#include "io/serial.h"
|
#include "io/serial.h"
|
||||||
#include "io/gps.h"
|
#include "io/gps.h"
|
||||||
//#include "io/osd.h"
|
|
||||||
//#include "io/vtx.h"
|
|
||||||
|
|
||||||
#include "flight/failsafe.h"
|
#include "flight/failsafe.h"
|
||||||
#include "flight/mixer.h"
|
#include "flight/mixer.h"
|
||||||
|
|
|
@ -53,9 +53,6 @@
|
||||||
#include "config/config_master.h"
|
#include "config/config_master.h"
|
||||||
#include "config/feature.h"
|
#include "config/feature.h"
|
||||||
|
|
||||||
// Short hands
|
|
||||||
#define OSD_cfg masterConfig.osdProfile
|
|
||||||
|
|
||||||
#ifdef USE_HARDWARE_REVISION_DETECTION
|
#ifdef USE_HARDWARE_REVISION_DETECTION
|
||||||
#include "hardware_revision.h"
|
#include "hardware_revision.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -80,17 +77,8 @@ extern serialPort_t *debugSerialPort;
|
||||||
#define IS_LO(X) (rcData[X] < 1250)
|
#define IS_LO(X) (rcData[X] < 1250)
|
||||||
#define IS_MID(X) (rcData[X] > 1250 && rcData[X] < 1750)
|
#define IS_MID(X) (rcData[X] > 1250 && rcData[X] < 1750)
|
||||||
|
|
||||||
//#define VISIBLE_FLAG 0x0800 // defined in osd.h
|
|
||||||
#define BLINK_FLAG 0x0400
|
|
||||||
bool blinkState = true;
|
bool blinkState = true;
|
||||||
|
|
||||||
#define OSD_POS(x,y) (x | (y << 5))
|
|
||||||
#define OSD_X(x) (x & 0x001F)
|
|
||||||
#define OSD_Y(x) ((x >> 5) & 0x001F)
|
|
||||||
//#define VISIBLE(x) (x & VISIBLE_FLAG) // defined in osd.h
|
|
||||||
#define BLINK(x) ((x & BLINK_FLAG) && blinkState)
|
|
||||||
#define BLINK_OFF(x) (x & ~BLINK_FLAG)
|
|
||||||
|
|
||||||
//extern uint8_t RSSI; // TODO: not used?
|
//extern uint8_t RSSI; // TODO: not used?
|
||||||
|
|
||||||
static uint16_t flyTime = 0;
|
static uint16_t flyTime = 0;
|
||||||
|
@ -158,11 +146,11 @@ void osdDrawElements(void)
|
||||||
|
|
||||||
void osdDrawSingleElement(uint8_t item)
|
void osdDrawSingleElement(uint8_t item)
|
||||||
{
|
{
|
||||||
if (!VISIBLE(OSD_cfg.item_pos[item]) || BLINK(OSD_cfg.item_pos[item]))
|
if (!VISIBLE(masterConfig.osdProfile.item_pos[item]) || BLINK(masterConfig.osdProfile.item_pos[item]))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint8_t elemPosX = OSD_X(OSD_cfg.item_pos[item]);
|
uint8_t elemPosX = OSD_X(masterConfig.osdProfile.item_pos[item]);
|
||||||
uint8_t elemPosY = OSD_Y(OSD_cfg.item_pos[item]);
|
uint8_t elemPosY = OSD_Y(masterConfig.osdProfile.item_pos[item]);
|
||||||
char buff[32];
|
char buff[32];
|
||||||
|
|
||||||
switch(item) {
|
switch(item) {
|
||||||
|
@ -396,7 +384,7 @@ void osdInit(void)
|
||||||
|
|
||||||
armState = ARMING_FLAG(ARMED);
|
armState = ARMING_FLAG(ARMED);
|
||||||
|
|
||||||
max7456Init(OSD_cfg.video_system);
|
max7456Init(masterConfig.osdProfile.video_system);
|
||||||
|
|
||||||
max7456ClearScreen();
|
max7456ClearScreen();
|
||||||
|
|
||||||
|
@ -413,9 +401,9 @@ void osdInit(void)
|
||||||
|
|
||||||
sprintf(string_buffer, "BF VERSION: %s", FC_VERSION_STRING);
|
sprintf(string_buffer, "BF VERSION: %s", FC_VERSION_STRING);
|
||||||
max7456Write(5, 6, string_buffer);
|
max7456Write(5, 6, string_buffer);
|
||||||
max7456Write(7, 7, "MENU: THRT MID");
|
max7456Write(7, 7, STARTUP_HELP_TEXT1);
|
||||||
max7456Write(13, 8, "YAW RIGHT");
|
max7456Write(12, 8, STARTUP_HELP_TEXT2);
|
||||||
max7456Write(13, 9, "PITCH UP");
|
max7456Write(12, 9, STARTUP_HELP_TEXT3);
|
||||||
|
|
||||||
cmsScreenResync(); // Was max7456RefreshAll(); may be okay.
|
cmsScreenResync(); // Was max7456RefreshAll(); may be okay.
|
||||||
|
|
||||||
|
@ -427,7 +415,7 @@ void osdInit(void)
|
||||||
*/
|
*/
|
||||||
char osdGetAltitudeSymbol()
|
char osdGetAltitudeSymbol()
|
||||||
{
|
{
|
||||||
switch (OSD_cfg.units) {
|
switch (masterConfig.osdProfile.units) {
|
||||||
case OSD_UNIT_IMPERIAL:
|
case OSD_UNIT_IMPERIAL:
|
||||||
return 0xF;
|
return 0xF;
|
||||||
default:
|
default:
|
||||||
|
@ -441,7 +429,7 @@ char osdGetAltitudeSymbol()
|
||||||
*/
|
*/
|
||||||
int32_t osdGetAltitude(int32_t alt)
|
int32_t osdGetAltitude(int32_t alt)
|
||||||
{
|
{
|
||||||
switch (OSD_cfg.units) {
|
switch (masterConfig.osdProfile.units) {
|
||||||
case OSD_UNIT_IMPERIAL:
|
case OSD_UNIT_IMPERIAL:
|
||||||
return (alt * 328) / 100; // Convert to feet / 100
|
return (alt * 328) / 100; // Convert to feet / 100
|
||||||
default:
|
default:
|
||||||
|
@ -454,44 +442,44 @@ void osdUpdateAlarms(void)
|
||||||
int32_t alt = osdGetAltitude(BaroAlt) / 100;
|
int32_t alt = osdGetAltitude(BaroAlt) / 100;
|
||||||
statRssi = rssi * 100 / 1024;
|
statRssi = rssi * 100 / 1024;
|
||||||
|
|
||||||
if (statRssi < OSD_cfg.rssi_alarm)
|
if (statRssi < masterConfig.osdProfile.rssi_alarm)
|
||||||
OSD_cfg.item_pos[OSD_RSSI_VALUE] |= BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_RSSI_VALUE] |= BLINK_FLAG;
|
||||||
else
|
else
|
||||||
OSD_cfg.item_pos[OSD_RSSI_VALUE] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_RSSI_VALUE] &= ~BLINK_FLAG;
|
||||||
|
|
||||||
if (vbat <= (batteryWarningVoltage - 1))
|
if (vbat <= (batteryWarningVoltage - 1))
|
||||||
OSD_cfg.item_pos[OSD_MAIN_BATT_VOLTAGE] |= BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_MAIN_BATT_VOLTAGE] |= BLINK_FLAG;
|
||||||
else
|
else
|
||||||
OSD_cfg.item_pos[OSD_MAIN_BATT_VOLTAGE] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_MAIN_BATT_VOLTAGE] &= ~BLINK_FLAG;
|
||||||
|
|
||||||
if (STATE(GPS_FIX) == 0)
|
if (STATE(GPS_FIX) == 0)
|
||||||
OSD_cfg.item_pos[OSD_GPS_SATS] |= BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_GPS_SATS] |= BLINK_FLAG;
|
||||||
else
|
else
|
||||||
OSD_cfg.item_pos[OSD_GPS_SATS] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_GPS_SATS] &= ~BLINK_FLAG;
|
||||||
|
|
||||||
if (flyTime / 60 >= OSD_cfg.time_alarm && ARMING_FLAG(ARMED))
|
if (flyTime / 60 >= masterConfig.osdProfile.time_alarm && ARMING_FLAG(ARMED))
|
||||||
OSD_cfg.item_pos[OSD_FLYTIME] |= BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_FLYTIME] |= BLINK_FLAG;
|
||||||
else
|
else
|
||||||
OSD_cfg.item_pos[OSD_FLYTIME] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_FLYTIME] &= ~BLINK_FLAG;
|
||||||
|
|
||||||
if (mAhDrawn >= OSD_cfg.cap_alarm)
|
if (mAhDrawn >= masterConfig.osdProfile.cap_alarm)
|
||||||
OSD_cfg.item_pos[OSD_MAH_DRAWN] |= BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_MAH_DRAWN] |= BLINK_FLAG;
|
||||||
else
|
else
|
||||||
OSD_cfg.item_pos[OSD_MAH_DRAWN] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_MAH_DRAWN] &= ~BLINK_FLAG;
|
||||||
|
|
||||||
if (alt >= OSD_cfg.alt_alarm)
|
if (alt >= masterConfig.osdProfile.alt_alarm)
|
||||||
OSD_cfg.item_pos[OSD_ALTITUDE] |= BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_ALTITUDE] |= BLINK_FLAG;
|
||||||
else
|
else
|
||||||
OSD_cfg.item_pos[OSD_ALTITUDE] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_ALTITUDE] &= ~BLINK_FLAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
void osdResetAlarms(void)
|
void osdResetAlarms(void)
|
||||||
{
|
{
|
||||||
OSD_cfg.item_pos[OSD_RSSI_VALUE] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_RSSI_VALUE] &= ~BLINK_FLAG;
|
||||||
OSD_cfg.item_pos[OSD_MAIN_BATT_VOLTAGE] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_MAIN_BATT_VOLTAGE] &= ~BLINK_FLAG;
|
||||||
OSD_cfg.item_pos[OSD_GPS_SATS] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_GPS_SATS] &= ~BLINK_FLAG;
|
||||||
OSD_cfg.item_pos[OSD_FLYTIME] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_FLYTIME] &= ~BLINK_FLAG;
|
||||||
OSD_cfg.item_pos[OSD_MAH_DRAWN] &= ~BLINK_FLAG;
|
masterConfig.osdProfile.item_pos[OSD_MAH_DRAWN] &= ~BLINK_FLAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
void osdResetStats(void)
|
void osdResetStats(void)
|
||||||
|
@ -654,20 +642,42 @@ void osdUpdate(uint32_t currentTime)
|
||||||
// OSD specific CMS functions
|
// OSD specific CMS functions
|
||||||
//
|
//
|
||||||
|
|
||||||
void osdGetSize(uint8_t *pRows, uint8_t *pCols)
|
void osdGetDevParam(uint8_t *pRows, uint8_t *pCols, uint16_t *pBuftime, uint16_t *pBufsize)
|
||||||
{
|
{
|
||||||
*pRows = max7456GetRowsCount();
|
*pRows = max7456GetRowsCount();
|
||||||
*pCols = 30;
|
*pCols = 30;
|
||||||
|
*pBuftime = 1; // Very fast
|
||||||
|
*pBufsize = 50000; // Very large
|
||||||
}
|
}
|
||||||
|
|
||||||
void osdMenuBegin(void) {
|
int osdMenuBegin(void)
|
||||||
|
{
|
||||||
osdResetAlarms();
|
osdResetAlarms();
|
||||||
osdInMenu = true;
|
osdInMenu = true;
|
||||||
refreshTimeout = 0;
|
refreshTimeout = 0;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void osdMenuEnd(void) {
|
int osdMenuEnd(void)
|
||||||
|
{
|
||||||
osdInMenu = false;
|
osdInMenu = false;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int osdClearScreen(void)
|
||||||
|
{
|
||||||
|
max7456ClearScreen();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int osdWrite(uint8_t x, uint8_t y, char *s)
|
||||||
|
{
|
||||||
|
max7456Write(x, y, s);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EDIT_ELEMENT_SUPPORT
|
#ifdef EDIT_ELEMENT_SUPPORT
|
||||||
|
@ -688,20 +698,20 @@ void osdEditElement(void *ptr)
|
||||||
|
|
||||||
void osdDrawElementPositioningHelp(void)
|
void osdDrawElementPositioningHelp(void)
|
||||||
{
|
{
|
||||||
max7456Write(OSD_X(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]), "--- HELP --- ");
|
max7456Write(OSD_X(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]), "--- HELP --- ");
|
||||||
max7456Write(OSD_X(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]) + 1, "USE ROLL/PITCH");
|
max7456Write(OSD_X(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]) + 1, "USE ROLL/PITCH");
|
||||||
max7456Write(OSD_X(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]) + 2, "TO MOVE ELEM. ");
|
max7456Write(OSD_X(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]) + 2, "TO MOVE ELEM. ");
|
||||||
max7456Write(OSD_X(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]) + 3, " ");
|
max7456Write(OSD_X(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]) + 3, " ");
|
||||||
max7456Write(OSD_X(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(OSD_cfg.item_pos[OSD_ARTIFICIAL_HORIZON]) + 4, "YAW - EXIT ");
|
max7456Write(OSD_X(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]), OSD_Y(masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON]) + 4, "YAW - EXIT ");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
screenFnVTable_t osdVTable = {
|
screenFnVTable_t osdVTable = {
|
||||||
osdGetSize,
|
osdGetDevParam,
|
||||||
osdMenuBegin,
|
osdMenuBegin,
|
||||||
osdMenuEnd,
|
osdMenuEnd,
|
||||||
max7456ClearScreen,
|
osdClearScreen,
|
||||||
max7456Write,
|
osdWrite,
|
||||||
NULL,
|
NULL,
|
||||||
max7456RefreshAll,
|
max7456RefreshAll,
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OSD_RSSI_VALUE,
|
OSD_RSSI_VALUE,
|
||||||
OSD_MAIN_BATT_VOLTAGE,
|
OSD_MAIN_BATT_VOLTAGE,
|
||||||
|
@ -70,5 +68,13 @@ void osdInit(void);
|
||||||
void resetOsdConfig(osd_profile_t *osdProfile);
|
void resetOsdConfig(osd_profile_t *osdProfile);
|
||||||
screenFnVTable_t *osdCmsInit(void);
|
screenFnVTable_t *osdCmsInit(void);
|
||||||
|
|
||||||
|
// Character coordinate and attributes
|
||||||
|
|
||||||
|
#define OSD_POS(x,y) (x | (y << 5))
|
||||||
|
#define OSD_X(x) (x & 0x001F)
|
||||||
|
#define OSD_Y(x) ((x >> 5) & 0x001F)
|
||||||
#define VISIBLE_FLAG 0x0800
|
#define VISIBLE_FLAG 0x0800
|
||||||
|
#define BLINK_FLAG 0x0400
|
||||||
#define VISIBLE(x) (x & VISIBLE_FLAG)
|
#define VISIBLE(x) (x & VISIBLE_FLAG)
|
||||||
|
#define BLINK(x) ((x & BLINK_FLAG) && blinkState)
|
||||||
|
#define BLINK_OFF(x) (x & ~BLINK_FLAG)
|
||||||
|
|
|
@ -65,8 +65,6 @@
|
||||||
#include "io/gps.h"
|
#include "io/gps.h"
|
||||||
#include "io/ledstrip.h"
|
#include "io/ledstrip.h"
|
||||||
#include "io/beeper.h"
|
#include "io/beeper.h"
|
||||||
//#include "io/osd.h"
|
|
||||||
//#include "io/vtx.h"
|
|
||||||
|
|
||||||
#include "rx/rx.h"
|
#include "rx/rx.h"
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,6 @@
|
||||||
#include "io/gps.h"
|
#include "io/gps.h"
|
||||||
#include "io/gimbal.h"
|
#include "io/gimbal.h"
|
||||||
#include "io/serial.h"
|
#include "io/serial.h"
|
||||||
//#include "io/ledstrip.h"
|
|
||||||
//#include "io/osd.h"
|
|
||||||
//#include "io/vtx.h"
|
|
||||||
|
|
||||||
#include "sensors/boardalignment.h"
|
#include "sensors/boardalignment.h"
|
||||||
#include "sensors/sensors.h"
|
#include "sensors/sensors.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue