mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Touch-ups after rebase
Led strip’s color manipulation was dropped due to the drastically change in the config structure; led strip menu now only has feature on/off.
This commit is contained in:
parent
e9a2f2b2c1
commit
a6b03a9473
8 changed files with 72 additions and 122 deletions
|
@ -542,12 +542,18 @@ static void cmsTraverseGlobalExit(CMS_Menu *pMenu)
|
||||||
{
|
{
|
||||||
OSD_Entry *p;
|
OSD_Entry *p;
|
||||||
|
|
||||||
for (p = pMenu->entries; p->type != OME_END ; p++)
|
debug[0]++;
|
||||||
if (p->type == OME_Submenu)
|
|
||||||
cmsTraverseGlobalExit(p->data);
|
|
||||||
|
|
||||||
if (pMenu->onGlobalExit)
|
for (p = pMenu->entries; p->type != OME_END ; p++) {
|
||||||
|
if (p->type == OME_Submenu) {
|
||||||
|
cmsTraverseGlobalExit(p->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pMenu->onGlobalExit) {
|
||||||
|
debug[1]++;
|
||||||
pMenu->onGlobalExit();
|
pMenu->onGlobalExit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
long cmsMenuExit(displayPort_t *pDisplay, void *ptr)
|
long cmsMenuExit(displayPort_t *pDisplay, void *ptr)
|
||||||
|
@ -566,6 +572,8 @@ long cmsMenuExit(displayPort_t *pDisplay, void *ptr)
|
||||||
|
|
||||||
if (currentMenu->onExit)
|
if (currentMenu->onExit)
|
||||||
currentMenu->onExit((OSD_Entry *)NULL); // Forced exit
|
currentMenu->onExit((OSD_Entry *)NULL); // Forced exit
|
||||||
|
|
||||||
|
saveConfigAndNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmsInMenu = false;
|
cmsInMenu = false;
|
||||||
|
@ -834,7 +842,7 @@ void cmsHandler(uint32_t currentTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Will initializing with menuMain be better?
|
// Is initializing with menuMain better?
|
||||||
// Can it be done with the current main()?
|
// Can it be done with the current main()?
|
||||||
void cmsInit(void)
|
void cmsInit(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "io/flashfs.h"
|
#include "io/flashfs.h"
|
||||||
|
|
||||||
#ifdef USE_FLASHFS
|
#ifdef USE_FLASHFS
|
||||||
long cmsx_EraseFlash(displayPort_t *pDisplay, void *ptr)
|
static long cmsx_EraseFlash(displayPort_t *pDisplay, void *ptr)
|
||||||
{
|
{
|
||||||
UNUSED(ptr);
|
UNUSED(ptr);
|
||||||
|
|
||||||
|
@ -46,16 +46,20 @@ long cmsx_EraseFlash(displayPort_t *pDisplay, void *ptr)
|
||||||
}
|
}
|
||||||
#endif // USE_FLASHFS
|
#endif // USE_FLASHFS
|
||||||
|
|
||||||
uint8_t cmsx_FeatureBlackbox;
|
static bool featureRead = false;
|
||||||
|
static uint8_t cmsx_FeatureBlackbox;
|
||||||
|
|
||||||
long cmsx_Blackbox_FeatureRead(void)
|
static long cmsx_Blackbox_FeatureRead(void)
|
||||||
{
|
{
|
||||||
cmsx_FeatureBlackbox = feature(FEATURE_BLACKBOX) ? 1 : 0;
|
if (!featureRead) {
|
||||||
|
cmsx_FeatureBlackbox = feature(FEATURE_BLACKBOX) ? 1 : 0;
|
||||||
|
featureRead = true;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long cmsx_Blackbox_FeatureWriteback(void)
|
static long cmsx_Blackbox_FeatureWriteback(void)
|
||||||
{
|
{
|
||||||
if (cmsx_FeatureBlackbox)
|
if (cmsx_FeatureBlackbox)
|
||||||
featureSet(FEATURE_BLACKBOX);
|
featureSet(FEATURE_BLACKBOX);
|
||||||
|
@ -65,9 +69,9 @@ long cmsx_Blackbox_FeatureWriteback(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSD_UINT8_t entryBlackboxRateDenom = {&masterConfig.blackbox_rate_denom,1,32,1};
|
static OSD_UINT8_t entryBlackboxRateDenom = {&masterConfig.blackbox_rate_denom,1,32,1};
|
||||||
|
|
||||||
OSD_Entry cmsx_menuBlackboxEntries[] =
|
static OSD_Entry cmsx_menuBlackboxEntries[] =
|
||||||
{
|
{
|
||||||
{"--- BLACKBOX ---", OME_Label, NULL, NULL, 0},
|
{"--- BLACKBOX ---", OME_Label, NULL, NULL, 0},
|
||||||
{"ENABLED", OME_Bool, NULL, &cmsx_FeatureBlackbox, 0},
|
{"ENABLED", OME_Bool, NULL, &cmsx_FeatureBlackbox, 0},
|
||||||
|
|
|
@ -121,5 +121,4 @@ CMS_Menu menuMain = {
|
||||||
NULL,
|
NULL,
|
||||||
menuMainEntries,
|
menuMainEntries,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -31,9 +31,9 @@
|
||||||
#include "config/config_master.h"
|
#include "config/config_master.h"
|
||||||
#include "config/feature.h"
|
#include "config/feature.h"
|
||||||
|
|
||||||
OSD_UINT8_t entryPidProfile = {&masterConfig.current_profile_index, 0, MAX_PROFILE_COUNT, 1};
|
static OSD_UINT8_t entryPidProfile = {&masterConfig.current_profile_index, 0, MAX_PROFILE_COUNT, 1};
|
||||||
|
|
||||||
uint8_t tempPid[4][3];
|
static uint8_t tempPid[4][3];
|
||||||
|
|
||||||
static OSD_UINT8_t entryRollP = {&tempPid[PIDROLL][0], 10, 150, 1};
|
static OSD_UINT8_t entryRollP = {&tempPid[PIDROLL][0], 10, 150, 1};
|
||||||
static OSD_UINT8_t entryRollI = {&tempPid[PIDROLL][1], 1, 150, 1};
|
static OSD_UINT8_t entryRollI = {&tempPid[PIDROLL][1], 1, 150, 1};
|
||||||
|
@ -47,7 +47,7 @@ static OSD_UINT8_t entryYawP = {&tempPid[PIDYAW][0], 10, 150, 1};
|
||||||
static OSD_UINT8_t entryYawI = {&tempPid[PIDYAW][1], 1, 150, 1};
|
static OSD_UINT8_t entryYawI = {&tempPid[PIDYAW][1], 1, 150, 1};
|
||||||
static OSD_UINT8_t entryYawD = {&tempPid[PIDYAW][2], 0, 150, 1};
|
static OSD_UINT8_t entryYawD = {&tempPid[PIDYAW][2], 0, 150, 1};
|
||||||
|
|
||||||
long cmsx_PidRead(void)
|
static long cmsx_PidRead(void)
|
||||||
{
|
{
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ long cmsx_PidRead(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long cmsx_PidWriteback(OSD_Entry *self)
|
static long cmsx_PidWriteback(OSD_Entry *self)
|
||||||
{
|
{
|
||||||
UNUSED(self);
|
UNUSED(self);
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ long cmsx_PidWriteback(OSD_Entry *self)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSD_Entry cmsx_menuPidEntries[] =
|
static OSD_Entry cmsx_menuPidEntries[] =
|
||||||
{
|
{
|
||||||
{"--- PID ---", OME_Label, NULL, NULL, 0},
|
{"--- PID ---", OME_Label, NULL, NULL, 0},
|
||||||
{"ROLL P", OME_UINT8, NULL, &entryRollP, 0},
|
{"ROLL P", OME_UINT8, NULL, &entryRollP, 0},
|
||||||
|
@ -101,7 +101,7 @@ OSD_Entry cmsx_menuPidEntries[] =
|
||||||
{NULL, OME_END, NULL, NULL, 0}
|
{NULL, OME_END, NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
CMS_Menu cmsx_menuPid = {
|
static CMS_Menu cmsx_menuPid = {
|
||||||
"MENUPID",
|
"MENUPID",
|
||||||
OME_MENU,
|
OME_MENU,
|
||||||
cmsx_PidRead,
|
cmsx_PidRead,
|
||||||
|
@ -113,7 +113,7 @@ CMS_Menu cmsx_menuPid = {
|
||||||
//
|
//
|
||||||
// Rate & Expo
|
// Rate & Expo
|
||||||
//
|
//
|
||||||
controlRateConfig_t rateProfile;
|
static controlRateConfig_t rateProfile;
|
||||||
|
|
||||||
static OSD_FLOAT_t entryRollRate = {&rateProfile.rates[0], 0, 250, 1, 10};
|
static OSD_FLOAT_t entryRollRate = {&rateProfile.rates[0], 0, 250, 1, 10};
|
||||||
static OSD_FLOAT_t entryPitchRate = {&rateProfile.rates[1], 0, 250, 1, 10};
|
static OSD_FLOAT_t entryPitchRate = {&rateProfile.rates[1], 0, 250, 1, 10};
|
||||||
|
@ -127,14 +127,14 @@ static OSD_UINT16_t entryTpaBreak = {&rateProfile.tpa_breakpoint, 1100, 1800, 10
|
||||||
static OSD_FLOAT_t entryPSetpoint = {&masterConfig.profile[0].pidProfile.setpointRelaxRatio, 0, 100, 1, 10};
|
static OSD_FLOAT_t entryPSetpoint = {&masterConfig.profile[0].pidProfile.setpointRelaxRatio, 0, 100, 1, 10};
|
||||||
static OSD_FLOAT_t entryDSetpoint = {&masterConfig.profile[0].pidProfile.dtermSetpointWeight, 0, 255, 1, 10};
|
static OSD_FLOAT_t entryDSetpoint = {&masterConfig.profile[0].pidProfile.dtermSetpointWeight, 0, 255, 1, 10};
|
||||||
|
|
||||||
long cmsx_RateExpoRead(void)
|
static long cmsx_RateExpoRead(void)
|
||||||
{
|
{
|
||||||
memcpy(&rateProfile, &masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile], sizeof(controlRateConfig_t));
|
memcpy(&rateProfile, &masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile], sizeof(controlRateConfig_t));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long cmsx_RateExpoWriteback(OSD_Entry *self)
|
static long cmsx_RateExpoWriteback(OSD_Entry *self)
|
||||||
{
|
{
|
||||||
UNUSED(self);
|
UNUSED(self);
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ long cmsx_RateExpoWriteback(OSD_Entry *self)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long cmsx_menuRcConfirmBack(OSD_Entry *self)
|
static long cmsx_menuRcConfirmBack(OSD_Entry *self)
|
||||||
{
|
{
|
||||||
if (self && self->type == OME_Back)
|
if (self && self->type == OME_Back)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -151,7 +151,7 @@ long cmsx_menuRcConfirmBack(OSD_Entry *self)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSD_Entry cmsx_menuRateExpoEntries[] =
|
static OSD_Entry cmsx_menuRateExpoEntries[] =
|
||||||
{
|
{
|
||||||
{"--- RATE&EXPO ---", OME_Label, NULL, NULL, 0},
|
{"--- RATE&EXPO ---", OME_Label, NULL, NULL, 0},
|
||||||
{"RC RATE", OME_FLOAT, NULL, &entryRcYawRate, 0},
|
{"RC RATE", OME_FLOAT, NULL, &entryRcYawRate, 0},
|
||||||
|
@ -191,7 +191,7 @@ static OSD_INT16_t entryRcAux2 = {&rcData[AUX2], 1, 2500, 0};
|
||||||
static OSD_INT16_t entryRcAux3 = {&rcData[AUX3], 1, 2500, 0};
|
static OSD_INT16_t entryRcAux3 = {&rcData[AUX3], 1, 2500, 0};
|
||||||
static OSD_INT16_t entryRcAux4 = {&rcData[AUX4], 1, 2500, 0};
|
static OSD_INT16_t entryRcAux4 = {&rcData[AUX4], 1, 2500, 0};
|
||||||
|
|
||||||
OSD_Entry cmsx_menuRcEntries[] =
|
static OSD_Entry cmsx_menuRcEntries[] =
|
||||||
{
|
{
|
||||||
{"--- RC PREV ---", OME_Label, NULL, NULL, 0},
|
{"--- RC PREV ---", OME_Label, NULL, NULL, 0},
|
||||||
{"ROLL", OME_INT16, NULL, &entryRcRoll, DYNAMIC},
|
{"ROLL", OME_INT16, NULL, &entryRcRoll, DYNAMIC},
|
||||||
|
@ -219,15 +219,15 @@ CMS_Menu cmsx_menuRc = {
|
||||||
//
|
//
|
||||||
// Misc
|
// Misc
|
||||||
//
|
//
|
||||||
OSD_UINT16_t entryMinThrottle = {&masterConfig.motorConfig.minthrottle, 1020, 1300, 10};
|
static OSD_UINT16_t entryMinThrottle = {&masterConfig.motorConfig.minthrottle, 1020, 1300, 10};
|
||||||
OSD_UINT8_t entryGyroSoftLpfHz = {&masterConfig.gyro_soft_lpf_hz, 0, 255, 1};
|
static OSD_UINT8_t entryGyroSoftLpfHz = {&masterConfig.gyro_soft_lpf_hz, 0, 255, 1};
|
||||||
OSD_UINT16_t entryDtermLpf = {&masterConfig.profile[0].pidProfile.dterm_lpf_hz, 0, 500, 5};
|
static OSD_UINT16_t entryDtermLpf = {&masterConfig.profile[0].pidProfile.dterm_lpf_hz, 0, 500, 5};
|
||||||
OSD_UINT16_t entryYawLpf = {&masterConfig.profile[0].pidProfile.yaw_lpf_hz, 0, 500, 5};
|
static OSD_UINT16_t entryYawLpf = {&masterConfig.profile[0].pidProfile.yaw_lpf_hz, 0, 500, 5};
|
||||||
OSD_UINT16_t entryYawPLimit = {&masterConfig.profile[0].pidProfile.yaw_p_limit, 100, 500, 5};
|
static OSD_UINT16_t entryYawPLimit = {&masterConfig.profile[0].pidProfile.yaw_p_limit, 100, 500, 5};
|
||||||
OSD_UINT8_t entryVbatScale = {&masterConfig.batteryConfig.vbatscale, 1, 250, 1};
|
static OSD_UINT8_t entryVbatScale = {&masterConfig.batteryConfig.vbatscale, 1, 250, 1};
|
||||||
OSD_UINT8_t entryVbatMaxCell = {&masterConfig.batteryConfig.vbatmaxcellvoltage, 10, 50, 1};
|
static OSD_UINT8_t entryVbatMaxCell = {&masterConfig.batteryConfig.vbatmaxcellvoltage, 10, 50, 1};
|
||||||
|
|
||||||
OSD_Entry menuImuMiscEntries[]=
|
static OSD_Entry menuImuMiscEntries[]=
|
||||||
{
|
{
|
||||||
{"--- MISC ---", OME_Label, NULL, NULL, 0},
|
{"--- MISC ---", OME_Label, NULL, NULL, 0},
|
||||||
{"GYRO LPF", OME_UINT8, NULL, &entryGyroSoftLpfHz, 0},
|
{"GYRO LPF", OME_UINT8, NULL, &entryGyroSoftLpfHz, 0},
|
||||||
|
@ -250,7 +250,7 @@ CMS_Menu menuImuMisc = {
|
||||||
menuImuMiscEntries,
|
menuImuMiscEntries,
|
||||||
};
|
};
|
||||||
|
|
||||||
OSD_Entry cmsx_menuImuEntries[] =
|
static OSD_Entry cmsx_menuImuEntries[] =
|
||||||
{
|
{
|
||||||
{"--- CFG.IMU ---", OME_Label, NULL, NULL, 0},
|
{"--- CFG.IMU ---", OME_Label, NULL, NULL, 0},
|
||||||
{"PID PROF", OME_UINT8, NULL, &entryPidProfile, 0},
|
{"PID PROF", OME_UINT8, NULL, &entryPidProfile, 0},
|
||||||
|
|
|
@ -21,69 +21,20 @@
|
||||||
|
|
||||||
#ifdef LED_STRIP
|
#ifdef LED_STRIP
|
||||||
|
|
||||||
//local variable to keep color value
|
static bool featureRead = false;
|
||||||
uint8_t ledColor;
|
static uint8_t cmsx_FeatureLedstrip;
|
||||||
|
|
||||||
static const char * const LED_COLOR_NAMES[] = {
|
static long cmsx_Ledstrip_FeatureRead(void)
|
||||||
"BLACK ",
|
|
||||||
"WHITE ",
|
|
||||||
"RED ",
|
|
||||||
"ORANGE ",
|
|
||||||
"YELLOW ",
|
|
||||||
"LIME GRN",
|
|
||||||
"GREEN ",
|
|
||||||
"MINT GRN",
|
|
||||||
"CYAN ",
|
|
||||||
"LT BLUE ",
|
|
||||||
"BLUE ",
|
|
||||||
"DK VIOLT",
|
|
||||||
"MAGENTA ",
|
|
||||||
"DEEP PNK"
|
|
||||||
};
|
|
||||||
|
|
||||||
//find first led with color flag and restore color index
|
|
||||||
//after saving all leds with flags color will have color set in OSD
|
|
||||||
void cmsx_GetLedColor(void)
|
|
||||||
{
|
{
|
||||||
for (int ledIndex = 0; ledIndex < LED_MAX_STRIP_LENGTH; ledIndex++) {
|
if (!featureRead) {
|
||||||
const ledConfig_t *ledConfig = &masterConfig.ledConfigs[ledIndex];
|
cmsx_FeatureLedstrip = feature(FEATURE_LED_STRIP) ? 1 : 0;
|
||||||
|
featureRead = true;
|
||||||
int fn = ledGetFunction(ledConfig);
|
|
||||||
|
|
||||||
if (fn == LED_FUNCTION_COLOR) {
|
|
||||||
ledColor = ledGetColor(ledConfig);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//udate all leds with flag color
|
|
||||||
static long applyLedColor(displayPort_t *pDisplay, void *ptr)
|
|
||||||
{
|
|
||||||
UNUSED(ptr);
|
|
||||||
UNUSED(pDisplay); // Arrgh
|
|
||||||
|
|
||||||
for (int ledIndex = 0; ledIndex < LED_MAX_STRIP_LENGTH; ledIndex++) {
|
|
||||||
ledConfig_t *ledConfig = &masterConfig.ledConfigs[ledIndex];
|
|
||||||
if (ledGetFunction(ledConfig) == LED_FUNCTION_COLOR)
|
|
||||||
*ledConfig = DEFINE_LED(ledGetX(ledConfig), ledGetY(ledConfig), ledColor, ledGetDirection(ledConfig), ledGetFunction(ledConfig), ledGetOverlay(ledConfig), 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t cmsx_FeatureLedstrip;
|
static long cmsx_Ledstrip_FeatureWriteback(void)
|
||||||
|
|
||||||
OSD_TAB_t entryLed = {&ledColor, 13, &LED_COLOR_NAMES[0]};
|
|
||||||
|
|
||||||
long cmsx_Ledstrip_FeatureRead(void)
|
|
||||||
{
|
|
||||||
cmsx_FeatureLedstrip = feature(FEATURE_LED_STRIP) ? 1 : 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
long cmsx_Ledstrip_FeatureWriteback(void)
|
|
||||||
{
|
{
|
||||||
if (cmsx_FeatureLedstrip)
|
if (cmsx_FeatureLedstrip)
|
||||||
featureSet(FEATURE_LED_STRIP);
|
featureSet(FEATURE_LED_STRIP);
|
||||||
|
@ -93,26 +44,10 @@ long cmsx_Ledstrip_FeatureWriteback(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long cmsx_Ledstrip_ConfigRead(void)
|
static OSD_Entry cmsx_menuLedstripEntries[] =
|
||||||
{
|
|
||||||
cmsx_GetLedColor();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
long cmsx_Ledstrip_onEnter(void)
|
|
||||||
{
|
|
||||||
cmsx_Ledstrip_FeatureRead();
|
|
||||||
cmsx_Ledstrip_ConfigRead();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
OSD_Entry cmsx_menuLedstripEntries[] =
|
|
||||||
{
|
{
|
||||||
{"--- LED STRIP ---", OME_Label, NULL, NULL, 0},
|
{"--- LED STRIP ---", OME_Label, NULL, NULL, 0},
|
||||||
{"ENABLED", OME_Bool, NULL, &cmsx_FeatureLedstrip, 0},
|
{"ENABLED", OME_Bool, NULL, &cmsx_FeatureLedstrip, 0},
|
||||||
{"LED COLOR", OME_TAB, applyLedColor, &entryLed, 0},
|
|
||||||
{"BACK", OME_Back, NULL, NULL, 0},
|
{"BACK", OME_Back, NULL, NULL, 0},
|
||||||
{NULL, OME_END, NULL, NULL, 0}
|
{NULL, OME_END, NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
@ -120,7 +55,7 @@ OSD_Entry cmsx_menuLedstripEntries[] =
|
||||||
CMS_Menu cmsx_menuLedstrip = {
|
CMS_Menu cmsx_menuLedstrip = {
|
||||||
"MENULED",
|
"MENULED",
|
||||||
OME_MENU,
|
OME_MENU,
|
||||||
cmsx_Ledstrip_onEnter,
|
cmsx_Ledstrip_FeatureRead,
|
||||||
NULL,
|
NULL,
|
||||||
cmsx_Ledstrip_FeatureWriteback,
|
cmsx_Ledstrip_FeatureWriteback,
|
||||||
cmsx_menuLedstripEntries,
|
cmsx_menuLedstripEntries,
|
||||||
|
|
|
@ -18,14 +18,18 @@
|
||||||
|
|
||||||
#if defined(VTX) || defined(USE_RTC6705)
|
#if defined(VTX) || defined(USE_RTC6705)
|
||||||
|
|
||||||
uint8_t cmsx_featureVtx = 0, cmsx_vtxBand, cmsx_vtxChannel;
|
static bool featureRead = false;
|
||||||
|
static uint8_t cmsx_featureVtx = 0, cmsx_vtxBand, cmsx_vtxChannel;
|
||||||
|
|
||||||
void cmsx_Vtx_FeatureRead(void)
|
static void cmsx_Vtx_FeatureRead(void)
|
||||||
{
|
{
|
||||||
cmsx_featureVtx = feature(FEATURE_VTX) ? 1 : 0;
|
if (!featureRead) {
|
||||||
|
cmsx_featureVtx = feature(FEATURE_VTX) ? 1 : 0;
|
||||||
|
featureRead = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmsx_Vtx_FeatureWriteback(void)
|
static void cmsx_Vtx_FeatureWriteback(void)
|
||||||
{
|
{
|
||||||
if (cmsx_featureVtx)
|
if (cmsx_featureVtx)
|
||||||
featureSet(FEATURE_VTX);
|
featureSet(FEATURE_VTX);
|
||||||
|
@ -41,10 +45,10 @@ static const char * const vtxBandNames[] = {
|
||||||
"RACEBAND",
|
"RACEBAND",
|
||||||
};
|
};
|
||||||
|
|
||||||
OSD_TAB_t entryVtxBand = {&cmsx_vtxBand,4,&vtxBandNames[0]};
|
static OSD_TAB_t entryVtxBand = {&cmsx_vtxBand,4,&vtxBandNames[0]};
|
||||||
OSD_UINT8_t entryVtxChannel = {&cmsx_vtxChannel, 1, 8, 1};
|
static OSD_UINT8_t entryVtxChannel = {&cmsx_vtxChannel, 1, 8, 1};
|
||||||
|
|
||||||
void cmsx_Vtx_ConfigRead(void)
|
static void cmsx_Vtx_ConfigRead(void)
|
||||||
{
|
{
|
||||||
#ifdef VTX
|
#ifdef VTX
|
||||||
cmsx_vtxBand = masterConfig.vtxBand;
|
cmsx_vtxBand = masterConfig.vtxBand;
|
||||||
|
@ -57,7 +61,7 @@ void cmsx_Vtx_ConfigRead(void)
|
||||||
#endif // USE_RTC6705
|
#endif // USE_RTC6705
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmsx_Vtx_ConfigWriteback(void)
|
static void cmsx_Vtx_ConfigWriteback(void)
|
||||||
{
|
{
|
||||||
#ifdef VTX
|
#ifdef VTX
|
||||||
masterConfig.vtxBand = cmsx_vtxBand;
|
masterConfig.vtxBand = cmsx_vtxBand;
|
||||||
|
@ -70,11 +74,11 @@ void cmsx_Vtx_ConfigWriteback(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VTX
|
#ifdef VTX
|
||||||
OSD_UINT8_t entryVtxMode = {&masterConfig.vtx_mode, 0, 2, 1};
|
static OSD_UINT8_t entryVtxMode = {&masterConfig.vtx_mode, 0, 2, 1};
|
||||||
OSD_UINT16_t entryVtxMhz = {&masterConfig.vtx_mhz, 5600, 5950, 1};
|
static OSD_UINT16_t entryVtxMhz = {&masterConfig.vtx_mhz, 5600, 5950, 1};
|
||||||
#endif // VTX
|
#endif // VTX
|
||||||
|
|
||||||
OSD_Entry cmsx_menuVtxEntries[] =
|
static OSD_Entry cmsx_menuVtxEntries[] =
|
||||||
{
|
{
|
||||||
{"--- VTX ---", OME_Label, NULL, NULL, 0},
|
{"--- VTX ---", OME_Label, NULL, NULL, 0},
|
||||||
{"ENABLED", OME_Bool, NULL, &cmsx_featureVtx, 0},
|
{"ENABLED", OME_Bool, NULL, &cmsx_featureVtx, 0},
|
||||||
|
|
|
@ -68,6 +68,7 @@ typedef struct {
|
||||||
void updateOsd(uint32_t currentTime);
|
void updateOsd(uint32_t currentTime);
|
||||||
void osdInit(void);
|
void osdInit(void);
|
||||||
void resetOsdConfig(osd_profile_t *osdProfile);
|
void resetOsdConfig(osd_profile_t *osdProfile);
|
||||||
|
void osdResetAlarms(void);
|
||||||
|
|
||||||
#ifdef CMS
|
#ifdef CMS
|
||||||
void osdCmsInit(displayPort_t *);
|
void osdCmsInit(displayPort_t *);
|
||||||
|
|
|
@ -12,10 +12,9 @@
|
||||||
#include "drivers/display.h"
|
#include "drivers/display.h"
|
||||||
#include "drivers/max7456.h"
|
#include "drivers/max7456.h"
|
||||||
|
|
||||||
displayPort_t osd7456DisplayPort;
|
displayPort_t osd7456DisplayPort; // Referenced from osd.c
|
||||||
|
|
||||||
extern uint16_t refreshTimeout;
|
extern uint16_t refreshTimeout;
|
||||||
void osdResetAlarms(void);
|
|
||||||
|
|
||||||
static int osdMenuBegin(displayPort_t *displayPort)
|
static int osdMenuBegin(displayPort_t *displayPort)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +70,7 @@ static uint32_t osdTxBytesFree(displayPort_t *displayPort)
|
||||||
return UINT32_MAX;
|
return UINT32_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
displayPortVTable_t osdVTable = {
|
static displayPortVTable_t osdVTable = {
|
||||||
osdMenuBegin,
|
osdMenuBegin,
|
||||||
osdMenuEnd,
|
osdMenuEnd,
|
||||||
osdClearScreen,
|
osdClearScreen,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue