Remove MENUS_LOCK
This commit is contained in:
@@ -807,7 +807,6 @@ PACK(struct TrainerData {
|
|||||||
uint8_t slidersConfig:4 ARRAY(1,struct_sliderConfig,nullptr); \
|
uint8_t slidersConfig:4 ARRAY(1,struct_sliderConfig,nullptr); \
|
||||||
uint8_t potsConfig ARRAY(2,struct_potConfig,nullptr); /* two bits per pot */\
|
uint8_t potsConfig ARRAY(2,struct_potConfig,nullptr); /* two bits per pot */\
|
||||||
uint8_t backlightColor; \
|
uint8_t backlightColor; \
|
||||||
swarnstate_t switchUnlockStates; \
|
|
||||||
CUST_ARRAY(sticksConfig, struct_sticksConfig, stick_name_valid); \
|
CUST_ARRAY(sticksConfig, struct_sticksConfig, stick_name_valid); \
|
||||||
swconfig_t switchConfig ARRAY(2,struct_switchConfig,nullptr); \
|
swconfig_t switchConfig ARRAY(2,struct_switchConfig,nullptr); \
|
||||||
char switchNames[STORAGE_NUM_SWITCHES][LEN_SWITCH_NAME] SKIP; \
|
char switchNames[STORAGE_NUM_SWITCHES][LEN_SWITCH_NAME] SKIP; \
|
||||||
|
|||||||
@@ -33,16 +33,6 @@ void drawSplash()
|
|||||||
{
|
{
|
||||||
lcdClear();
|
lcdClear();
|
||||||
lcdDraw1bitBitmap(0, 0, splash_lbm, 0, 0);
|
lcdDraw1bitBitmap(0, 0, splash_lbm, 0, 0);
|
||||||
|
|
||||||
#if MENUS_LOCK == 1
|
|
||||||
if (readonly == false) {
|
|
||||||
lcdDrawFilledRect((LCD_W - (sizeof(TR_UNLOCKED) - 1) * FW) / 2 - 9, 50,
|
|
||||||
(sizeof(TR_UNLOCKED) - 1) * FW + 16, 11, SOLID,
|
|
||||||
ERASE | ROUND);
|
|
||||||
lcdDrawText((LCD_W - (sizeof(TR_UNLOCKED) - 1) * FW) / 2, 53, STR_UNLOCKED);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -461,7 +461,6 @@ void menuMainView(event_t event)
|
|||||||
POPUP_MENU_START(onMainViewMenu);
|
POPUP_MENU_START(onMainViewMenu);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if MENUS_LOCK != 2 /*no menus*/
|
|
||||||
#if defined(EVT_KEY_LAST_MENU)
|
#if defined(EVT_KEY_LAST_MENU)
|
||||||
case EVT_KEY_LAST_MENU:
|
case EVT_KEY_LAST_MENU:
|
||||||
pushMenu(lastPopMenu());
|
pushMenu(lastPopMenu());
|
||||||
@@ -478,7 +477,7 @@ void menuMainView(event_t event)
|
|||||||
pushMenu(menuTabGeneral[0]);
|
pushMenu(menuTabGeneral[0]);
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
#if defined(HARDWARE_NO_TRIMS)
|
#if defined(HARDWARE_NO_TRIMS)
|
||||||
case EVT_KEY_FIRST(KEY_ENTER):
|
case EVT_KEY_FIRST(KEY_ENTER):
|
||||||
if (!trimSelection.preEnterValid) {
|
if (!trimSelection.preEnterValid) {
|
||||||
|
|||||||
@@ -37,16 +37,6 @@ void drawSplash()
|
|||||||
{
|
{
|
||||||
lcdClear();
|
lcdClear();
|
||||||
lcdDrawRleBitmap(0, 0, splash_lbm);
|
lcdDrawRleBitmap(0, 0, splash_lbm);
|
||||||
|
|
||||||
#if MENUS_LOCK == 1
|
|
||||||
if (readonly == false) {
|
|
||||||
lcdDrawFilledRect((LCD_W - (sizeof(TR_UNLOCKED) - 1) * FW) / 2 - 9, 50,
|
|
||||||
(sizeof(TR_UNLOCKED) - 1) * FW + 16, 11, SOLID,
|
|
||||||
ERASE | ROUND);
|
|
||||||
lcdDrawText((LCD_W - (sizeof(TR_UNLOCKED) - 1) * FW) / 2, 53, STR_UNLOCKED);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -449,7 +449,6 @@ void menuMainView(event_t event)
|
|||||||
POPUP_MENU_START(onMainViewMenu);
|
POPUP_MENU_START(onMainViewMenu);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if MENUS_LOCK != 2/*no menus*/
|
|
||||||
case EVT_KEY_BREAK(KEY_MENU):
|
case EVT_KEY_BREAK(KEY_MENU):
|
||||||
pushMenu(menuModelSelect);
|
pushMenu(menuModelSelect);
|
||||||
break;
|
break;
|
||||||
@@ -458,7 +457,6 @@ void menuMainView(event_t event)
|
|||||||
pushMenu(menuTabGeneral[0]);
|
pushMenu(menuTabGeneral[0]);
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_PAGE):
|
case EVT_KEY_BREAK(KEY_PAGE):
|
||||||
storageDirty(EE_MODEL);
|
storageDirty(EE_MODEL);
|
||||||
|
|||||||
+1
-24
@@ -579,20 +579,6 @@ void resetBacklightTimeout()
|
|||||||
lightOffCounter = ((uint16_t)g_eeGeneral.lightAutoOff*250) << 1;
|
lightOffCounter = ((uint16_t)g_eeGeneral.lightAutoOff*250) << 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MENUS_LOCK == 1
|
|
||||||
bool readonly = true;
|
|
||||||
bool readonlyUnlocked()
|
|
||||||
{
|
|
||||||
if (readonly) {
|
|
||||||
POPUP_WARNING(STR_MODS_FORBIDDEN);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SPLASH)
|
#if defined(SPLASH)
|
||||||
void doSplash()
|
void doSplash()
|
||||||
{
|
{
|
||||||
@@ -1750,9 +1736,7 @@ void opentxInit()
|
|||||||
#elif defined(GUI)
|
#elif defined(GUI)
|
||||||
// TODO add a function for this (duplicated)
|
// TODO add a function for this (duplicated)
|
||||||
menuHandlers[0] = menuMainView;
|
menuHandlers[0] = menuMainView;
|
||||||
#if MENUS_LOCK != 2/*no menus*/
|
menuHandlers[1] = menuModelSelect;
|
||||||
menuHandlers[1] = menuModelSelect;
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(EEPROM)
|
#if defined(EEPROM)
|
||||||
@@ -1857,13 +1841,6 @@ void opentxInit()
|
|||||||
aux2SerialInit(g_eeGeneral.aux2SerialMode, modelTelemetryProtocol());
|
aux2SerialInit(g_eeGeneral.aux2SerialMode, modelTelemetryProtocol());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MENUS_LOCK == 1
|
|
||||||
getMovedSwitch();
|
|
||||||
if (TRIMS_PRESSED() && g_eeGeneral.switchUnlockStates==switches_states) {
|
|
||||||
readonly = false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
currentSpeakerVolume = requiredSpeakerVolume = g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF;
|
currentSpeakerVolume = requiredSpeakerVolume = g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF;
|
||||||
currentBacklightBright = requiredBacklightBright = g_eeGeneral.backlightBright;
|
currentBacklightBright = requiredBacklightBright = g_eeGeneral.backlightBright;
|
||||||
#if !defined(SOFTWARE_VOLUME)
|
#if !defined(SOFTWARE_VOLUME)
|
||||||
|
|||||||
+3
-9
@@ -621,15 +621,9 @@ void flightReset(uint8_t check=true);
|
|||||||
void doSplash();
|
void doSplash();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MENUS_LOCK == 1
|
// disabled function (not used anywhere)
|
||||||
extern bool readonly;
|
#define READ_ONLY() false
|
||||||
extern bool readonlyUnlocked();
|
#define READ_ONLY_UNLOCKED() true
|
||||||
#define READ_ONLY() readonly
|
|
||||||
#define READ_ONLY_UNLOCKED() readonlyUnlocked()
|
|
||||||
#else
|
|
||||||
#define READ_ONLY() false
|
|
||||||
#define READ_ONLY_UNLOCKED() true
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void checkLowEEPROM();
|
void checkLowEEPROM();
|
||||||
void checkThrottleStick();
|
void checkThrottleStick();
|
||||||
|
|||||||
@@ -925,11 +925,6 @@ const char * const STR_LSW_DESCRIPTIONS[] = TR_LSW_DESCRIPTIONS;
|
|||||||
const char * const STR_GVAR_HEADERS[] = TR_GVAR_HEADERS;
|
const char * const STR_GVAR_HEADERS[] = TR_GVAR_HEADERS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MENUS_LOCK == 1
|
|
||||||
const char STR_UNLOCKED[] = TR_UNLOCKED;
|
|
||||||
const char STR_MODS_FORBIDDEN[] = TR_MODS_FORBIDDEN;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BLUETOOTH)
|
#if defined(BLUETOOTH)
|
||||||
const char STR_BLUETOOTH[] = TR_BLUETOOTH;
|
const char STR_BLUETOOTH[] = TR_BLUETOOTH;
|
||||||
const char STR_BLUETOOTH_DISC[] = TR_BLUETOOTH_DISC;
|
const char STR_BLUETOOTH_DISC[] = TR_BLUETOOTH_DISC;
|
||||||
|
|||||||
@@ -1088,11 +1088,6 @@ extern const char STR_RTC_CHECK[];
|
|||||||
extern const char STR_SPORT_UPDATE_POWER_MODE[];
|
extern const char STR_SPORT_UPDATE_POWER_MODE[];
|
||||||
extern const char STR_SPORT_UPDATE_POWER_MODES[];
|
extern const char STR_SPORT_UPDATE_POWER_MODES[];
|
||||||
|
|
||||||
#if MENUS_LOCK == 1
|
|
||||||
extern const char STR_UNLOCKED[];
|
|
||||||
extern const char STR_MODS_FORBIDDEN[];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern const char STR_MODULE_RANGE[];
|
extern const char STR_MODULE_RANGE[];
|
||||||
extern const char STR_RECEIVER_OPTIONS[];
|
extern const char STR_RECEIVER_OPTIONS[];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user