feat(firmware): add a special function to trigger key lock (#7565)

This commit is contained in:
philmoz
2026-08-16 13:17:19 +10:00
committed by GitHub
parent a0c1aa7a2b
commit 6d793f9252
73 changed files with 829 additions and 608 deletions
@@ -122,6 +122,8 @@ QString CustomFunctionData::funcToString(const AssignFunc func, const ModelData
return tr("Racing Mode");
else if (func == FuncDisableTouch)
return tr("Disable Touch");
else if (func == FuncDisableKeys)
return tr("Disable Keys");
else if (func == FuncSetScreen)
return tr("Set Main Screen");
else if (func == FuncDisableAudioAmp)
@@ -491,6 +493,7 @@ bool CustomFunctionData::isParamAvailable() const
FuncBindExternalModule,
FuncRacingMode,
FuncDisableTouch,
FuncDisableKeys,
FuncDisableAudioAmp
};
@@ -68,6 +68,7 @@ enum AssignFunc {
FuncBindExternalModule,
FuncRacingMode,
FuncDisableTouch,
FuncDisableKeys,
FuncSetScreen,
FuncDisableAudioAmp,
FuncRGBLed,
@@ -64,6 +64,7 @@ static const YamlLookupTable customFnLut = {
{ FuncRGBLed, "RGB_LED" },
{ FuncLCDtoVideo, "LCD_TO_VIDEO" },
{ FuncPushCustomSwitch1, "PUSH_CUST_SWITCH" },
{ FuncDisableKeys, "DISABLE_KEYS" },
};
static const YamlLookupTable trainerLut = {
+58
View File
@@ -22,6 +22,7 @@
// This file is auto-generated via cfn_sorter.sh. Do not edit.
#include "dataconstants.h"
#include "hal_keys_lock.h"
Functions cfn_sorted[] = {
#if defined(TRANSLATIONS_CN)
@@ -62,6 +63,9 @@ Functions cfn_sorted[] = {
/* 暂停背景音乐 */ FUNC_BACKGND_MUSIC_PAUSE,
/* 振动 */ FUNC_HAPTIC,
/* LUA脚本 */ FUNC_PLAY_SCRIPT,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(FUNCTION_SWITCHES)
/* Push CS */ FUNC_PUSH_CUST_SWITCH,
#endif
@@ -89,6 +93,9 @@ Functions cfn_sorted[] = {
/* ModuleBind */ FUNC_BIND,
/* Nastav */ FUNC_ADJUST_GVAR,
/* Nastavit Failsafe */ FUNC_SET_FAILSAFE,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if !OLED_SCREEN
/* Podsvětlení */ FUNC_BACKLIGHT,
#endif
@@ -129,6 +136,9 @@ Functions cfn_sorted[] = {
/* Lua skript */ FUNC_PLAY_SCRIPT,
/* Lydstyrke */ FUNC_VOLUME,
/* Modul tilslut */ FUNC_BIND,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
/* Nulstil */ FUNC_RESET,
/* Overskriv */ FUNC_OVERRIDE_CHANNEL,
/* RGB lys */ FUNC_RGB_LED,
@@ -179,6 +189,9 @@ Functions cfn_sorted[] = {
#endif
/* Lua-Skript */ FUNC_PLAY_SCRIPT,
/* ModuleBind */ FUNC_BIND,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
/* RacingMode */ FUNC_RACING_MODE,
/* RangeCheck */ FUNC_RANGECHECK,
/* RGB LED */ FUNC_RGB_LED,
@@ -219,6 +232,9 @@ Functions cfn_sorted[] = {
#if !OLED_SCREEN
/* Luz Fondo */ FUNC_BACKLIGHT,
#endif
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(COLORLCD)
/* No Touch */ FUNC_DISABLE_TOUCH,
#endif
@@ -257,6 +273,9 @@ Functions cfn_sorted[] = {
#endif
/* Lua Script */ FUNC_PLAY_SCRIPT,
/* ModuleBind */ FUNC_BIND,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(COLORLCD)
/* No Touch */ FUNC_DISABLE_TOUCH,
#endif
@@ -301,6 +320,9 @@ Functions cfn_sorted[] = {
/* Luminosité */ FUNC_BACKLIGHT,
#endif
/* Musique */ FUNC_BACKGND_MUSIC,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(COLORLCD)
/* Non Tactile */ FUNC_DISABLE_TOUCH,
#endif
@@ -336,6 +358,9 @@ Functions cfn_sorted[] = {
#endif
/* Lua Script */ FUNC_PLAY_SCRIPT,
/* ModuleBind */ FUNC_BIND,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
/* Override */ FUNC_OVERRIDE_CHANNEL,
/* Play Track */ FUNC_PLAY_TRACK,
/* Play Value */ FUNC_PLAY_VALUE,
@@ -390,6 +415,9 @@ Functions cfn_sorted[] = {
/* Modo Racing */ FUNC_RACING_MODE,
/* Musica Sf */ FUNC_BACKGND_MUSIC,
/* Musica Sf || */ FUNC_BACKGND_MUSIC_PAUSE,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(FUNCTION_SWITCHES)
/* Premi CS */ FUNC_PUSH_CUST_SWITCH,
#endif
@@ -421,6 +449,9 @@ Functions cfn_sorted[] = {
/* LCD to Video */ FUNC_LCD_TO_VIDEO,
#endif
/* LUAスクリプト */ FUNC_PLAY_SCRIPT,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(FUNCTION_SWITCHES)
/* Push CS */ FUNC_PUSH_CUST_SWITCH,
#endif
@@ -459,6 +490,9 @@ Functions cfn_sorted[] = {
/* LCD -> 비디오 출력 */ FUNC_LCD_TO_VIDEO,
#endif
/* Lua 스크립트 실행 */ FUNC_PLAY_SCRIPT,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
/* RGB LED */ FUNC_RGB_LED,
/* SD 로그 저장 */ FUNC_LOGS,
/* 값 재생 */ FUNC_PLAY_VALUE,
@@ -515,6 +549,9 @@ Functions cfn_sorted[] = {
#endif
/* Lua Script */ FUNC_PLAY_SCRIPT,
/* ModuleBind */ FUNC_BIND,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(COLORLCD)
/* No Touch */ FUNC_DISABLE_TOUCH,
#endif
@@ -557,6 +594,9 @@ Functions cfn_sorted[] = {
/* ModuleBind */ FUNC_BIND,
/* Muz. tła */ FUNC_BACKGND_MUSIC,
/* Muz. tła || */ FUNC_BACKGND_MUSIC_PAUSE,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(COLORLCD)
/* No Touch */ FUNC_DISABLE_TOUCH,
#endif
@@ -605,6 +645,9 @@ Functions cfn_sorted[] = {
/* LuzFundo */ FUNC_BACKLIGHT,
#endif
/* ModCorrida */ FUNC_RACING_MODE,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(COLORLCD)
/* No Touch */ FUNC_DISABLE_TOUCH,
#endif
@@ -632,6 +675,9 @@ Functions cfn_sorted[] = {
/* LCD в видео */ FUNC_LCD_TO_VIDEO,
#endif
/* Lua скрипт */ FUNC_PLAY_SCRIPT,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
/* Play Value */ FUNC_PLAY_VALUE,
/* RGB подсветка */ FUNC_RGB_LED,
/* SD логи */ FUNC_LOGS,
@@ -690,6 +736,9 @@ Functions cfn_sorted[] = {
/* Lås */ FUNC_OVERRIDE_CHANNEL,
/* Lärare */ FUNC_TRAINER,
/* Musik */ FUNC_BACKGND_MUSIC,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
/* Parkoppla modul */ FUNC_BIND,
/* Pausa musik */ FUNC_BACKGND_MUSIC_PAUSE,
/* Range check */ FUNC_RANGECHECK,
@@ -714,6 +763,9 @@ Functions cfn_sorted[] = {
/* Återställ */ FUNC_RESET,
#elif defined(TRANSLATIONS_TW)
/* Lua腳本 */ FUNC_PLAY_SCRIPT,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(FUNCTION_SWITCHES)
/* Push CS */ FUNC_PUSH_CUST_SWITCH,
#endif
@@ -793,6 +845,9 @@ Functions cfn_sorted[] = {
/* LCD to Video */ FUNC_LCD_TO_VIDEO,
#endif
/* Lua Скрипт */ FUNC_PLAY_SCRIPT,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(FUNCTION_SWITCHES)
/* Push CS */ FUNC_PUSH_CUST_SWITCH,
#endif
@@ -816,6 +871,9 @@ Functions cfn_sorted[] = {
#endif
/* Lua Script */ FUNC_PLAY_SCRIPT,
/* ModuleBind */ FUNC_BIND,
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
/* No Keys */ FUNC_DISABLE_KEYS,
#endif
#if defined(COLORLCD)
/* No Touch */ FUNC_DISABLE_TOUCH,
#endif
+1
View File
@@ -739,6 +739,7 @@ enum Functions {
#if defined(FUNCTION_SWITCHES) || defined(CFN_ONLY)
FUNC_PUSH_CUST_SWITCH,
#endif
FUNC_DISABLE_KEYS,
FUNC_TEST, // MUST remain last
#if defined(DEBUG)
FUNC_MAX SKIP
+10 -2
View File
@@ -151,12 +151,19 @@ void memswap(void * a, void * b, uint8_t size);
struct CustomFunctionsContext {
MASK_FUNC_TYPE activeFunctions;
MASK_FUNC_TYPE activeUIFunctions;
MASK_CFN_TYPE activeSwitches;
MASK_CFN_TYPE activeUISwitches;
tmr10ms_t lastFunctionTime[MAX_SPECIAL_FUNCTIONS];
inline bool isFunctionActive(uint8_t func)
{
return activeFunctions & ((MASK_FUNC_TYPE)1 << func);
return (activeFunctions | activeUIFunctions) & ((MASK_FUNC_TYPE)1 << func);
}
inline bool isFunctionSwitchActive(uint8_t functionIdx)
{
return (activeSwitches | activeUISwitches) & ((MASK_CFN_TYPE)1 << functionIdx);
}
void reset()
@@ -421,7 +428,6 @@ inline bool isMixActive(uint8_t mix)
enum FunctionsActive {
FUNCTION_TRAINER_STICK1,
FUNCTION_TRAINER_CHANNELS = FUNCTION_TRAINER_STICK1 + MAX_STICKS,
FUNCTION_INSTANT_TRIM,
FUNCTION_VARIO,
FUNCTION_LOGS,
FUNCTION_BACKGND_MUSIC,
@@ -431,6 +437,7 @@ enum FunctionsActive {
FUNCTION_DISABLE_TOUCH,
FUNCTION_DISABLE_AUDIO_AMP,
FUNCTION_VOLUME,
FUNCTION_DISABLE_KEYS,
};
#define VARIO_FREQUENCY_ZERO 700/*Hz*/
@@ -445,6 +452,7 @@ inline bool isFunctionActive(uint8_t func)
return globalFunctionsContext.isFunctionActive(func) || modelFunctionsContext.isFunctionActive(func);
}
void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & functionsContext);
void evalUIFunctions(CustomFunctionData * functions, CustomFunctionsContext & functionsContext);
inline void customFunctionsReset()
{
globalFunctionsContext.reset();
+169 -75
View File
@@ -21,14 +21,11 @@
#include "edgetx.h"
#include "switches.h"
#include "tasks/mixer_task.h"
#include "hal/audio_driver.h"
#include "os/time.h"
#if defined(COLORLCD)
void setRequestedMainView(uint8_t view);
#endif
#if defined(VIDEO_SWITCH)
#include "videoswitch_driver.h"
#if defined(SIMU)
@@ -36,8 +33,8 @@ void switchToRadio() {};
void switchToVideo() {};
#endif
#endif
CustomFunctionsContext modelFunctionsContext = { 0 };
CustomFunctionsContext modelFunctionsContext = { 0 };
CustomFunctionsContext globalFunctionsContext = { 0 };
#if defined(DEBUG)
@@ -161,10 +158,26 @@ bool isRepeatDelayElapsed(const CustomFunctionData * functions, CustomFunctionsC
}
}
static bool isUIFunction(uint16_t f, int16_t p)
{
return f == FUNC_LOGS || f == FUNC_SET_SCREEN || f == FUNC_SCREENSHOT || f == FUNC_BACKLIGHT
#if defined(AUDIO)
|| f == FUNC_VOLUME
#endif
#if defined(HARDWARE_TOUCH)
|| f == FUNC_DISABLE_TOUCH
#endif
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
|| f == FUNC_DISABLE_KEYS
#endif
|| (f == FUNC_RESET && p == FUNC_RESET_FLIGHT);
}
void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & functionsContext)
{
MASK_FUNC_TYPE newActiveFunctions = 0;
MASK_FUNC_TYPE newActiveFunctions = 0;
MASK_CFN_TYPE newActiveSwitches = 0;
#if defined(FUNCTION_SWITCHES)
g_model.cfsResetSFState();
#endif
@@ -190,11 +203,14 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
CustomFunctionData * cfn = &functions[i];
// Skip functions evaluated in UI task
if (isUIFunction(CFN_FUNC(cfn), CFN_PARAM(cfn))) {
continue;
}
swsrc_t swtch = CFN_SWITCH(cfn);
if (swtch) {
MASK_CFN_TYPE switch_mask = ((MASK_CFN_TYPE)1 << i);
bool active = getSwitch(swtch, IS_PLAY_FUNC(CFN_FUNC(cfn)) ? GETSWITCH_MIDPOS_DELAY : 0);
// Handle case where function is disabled while active
if (CFN_ACTIVE(cfn) == 0)
active = false;
@@ -209,7 +225,8 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
case FUNC_TRAINER: {
uint8_t param = CFN_CH_INDEX(cfn);
if (param == 0)
newActiveFunctions |= 0x0F;
for (int i = 0; i < MAX_STICKS; i += 1)
newActiveFunctions |= (1u << i);
else if (param <= MAX_STICKS)
newActiveFunctions |= (1 << (param - 1));
else if (param == MAX_STICKS + 1)
@@ -218,9 +235,9 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
}
case FUNC_INSTANT_TRIM:
newActiveFunctions |= (1u << FUNCTION_INSTANT_TRIM);
if (!isFunctionActive(FUNCTION_INSTANT_TRIM)) {
if (IS_INSTANT_TRIM_ALLOWED()) {
if (IS_INSTANT_TRIM_ALLOWED()) {
// Use 'repeat' property to ensure single activation (repeat defaults to 1x)
if (isRepeatDelayElapsed(functions, functionsContext, i)) {
instantTrim();
}
}
@@ -234,18 +251,11 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
timerReset(CFN_PARAM(cfn));
break;
case FUNC_RESET_FLIGHT:
if (!(functionsContext.activeSwitches & switch_mask)) {
mainRequestFlags |=
(1 << REQUEST_FLIGHT_RESET); // on systems with threads
// flightReset() must not be
// called from the mixers
// thread!
}
// Handled in evalUIFunctions()
break;
case FUNC_RESET_TELEMETRY:
telemetryReset();
break;
case FUNC_RESET_TRIMS: {
for (uint8_t i = 0; i < keysGetMaxTrims(); i++) {
setTrimValue(mixerCurrentFlightMode, i, 0);
@@ -293,7 +303,7 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
CFN_PARAM(cfn))),
mixerCurrentFlightMode);
} else if (CFN_GVAR_MODE(cfn) == FUNC_ADJUST_GVAR_INCDEC) {
if (!(functionsContext.activeSwitches & switch_mask)) {
if (!functionsContext.isFunctionSwitchActive(i)) {
SET_GVAR(CFN_GVAR_INDEX(cfn),
limit<int16_t>(MODEL_GVAR_MIN(CFN_GVAR_INDEX(cfn)),
GVAR_VALUE(CFN_GVAR_INDEX(cfn),
@@ -325,14 +335,6 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
break;
#endif
#if defined(AUDIO)
case FUNC_VOLUME: {
newActiveFunctions |= (1u << FUNCTION_VOLUME);
calcVolumeValue(CFN_PARAM(cfn));
break;
}
#endif
case FUNC_PLAY_SOUND:
case FUNC_PLAY_TRACK:
case FUNC_PLAY_VALUE:
@@ -379,14 +381,6 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
break;
#endif
case FUNC_LOGS:
if (CFN_PARAM(cfn)) {
newActiveFunctions |= (1u << FUNCTION_LOGS);
logDelay100ms = CFN_PARAM(
cfn); // logging period is 0..25.5s in 100ms increments
}
break;
#if defined(FUNCTION_SWITCHES)
case FUNC_PUSH_CUST_SWITCH:
if (CFN_PARAM(cfn)) { // Duration is set
@@ -403,24 +397,6 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
break;
#endif
case FUNC_BACKLIGHT: {
newActiveFunctions |= (1u << FUNCTION_BACKLIGHT);
if (!CFN_PARAM(cfn)) { // When no source is set, backlight works
// like original backlight and turn on
// regardless of backlight settings
requiredBacklightBright = BACKLIGHT_FORCED_ON;
} else {
calcBacklightValue(CFN_PARAM(cfn));
}
break;
}
case FUNC_SCREENSHOT:
if (!(functionsContext.activeSwitches & switch_mask)) {
mainRequestFlags |= (1u << REQUEST_SCREENSHOT);
}
break;
#if defined(PXX2)
case FUNC_RACING_MODE:
if (isRacingModeEnabled()) {
@@ -428,35 +404,20 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
}
break;
#endif
#if defined(HARDWARE_TOUCH)
case FUNC_DISABLE_TOUCH:
newActiveFunctions |= (1u << FUNCTION_DISABLE_TOUCH);
break;
#endif
#if defined(AUDIO_MUTE_GPIO)
case FUNC_DISABLE_AUDIO_AMP:
newActiveFunctions |= (1u << FUNCTION_DISABLE_AUDIO_AMP);
break;
#endif
case FUNC_SET_SCREEN:
if (isRepeatDelayElapsed(functions, functionsContext, i)) {
TRACE("SET VIEW %d", (CFN_PARAM(cfn)));
#if defined(COLORLCD)
int8_t screenNumber = max(0, CFN_PARAM(cfn) - 1);
setRequestedMainView(screenNumber);
mainRequestFlags |= (1u << REQUEST_MAIN_VIEW);
#else
extern void showTelemScreen(uint8_t index);
showTelemScreen(CFN_PARAM(cfn));
#endif
}
break;
#if defined(VIDEO_SWITCH)
case FUNC_LCD_TO_VIDEO:
switchToVideo();
videoEnabled = true;
break;
#endif
#if defined(DEBUG)
case FUNC_TEST:
testFunc();
@@ -464,7 +425,7 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
#endif
}
newActiveSwitches |= switch_mask;
newActiveSwitches |= ((MASK_CFN_TYPE)1 << i);
} else {
#if defined(FUNCTION_SWITCHES)
if (CFN_FUNC(cfn) == FUNC_PUSH_CUST_SWITCH) {
@@ -479,7 +440,7 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
#endif
functionsContext.lastFunctionTime[i] = 0;
#if defined(DANGEROUS_MODULE_FUNCTIONS)
if (functionsContext.activeSwitches & switch_mask) {
if (functionsContext.isFunctionSwitchActive(i)) {
switch (CFN_FUNC(cfn)) {
case FUNC_RANGECHECK:
case FUNC_BIND:
@@ -506,6 +467,135 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
functionsContext.activeFunctions = newActiveFunctions;
}
void evalUIFunctions(CustomFunctionData * functions, CustomFunctionsContext & functionsContext)
{
MASK_FUNC_TYPE newActiveFunctions = 0;
MASK_CFN_TYPE newActiveSwitches = 0;
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
CustomFunctionData * cfn = &functions[i];
// Skip functions evaluated in mixer task
if (!isUIFunction(CFN_FUNC(cfn), CFN_PARAM(cfn))) {
continue;
}
swsrc_t swtch = CFN_SWITCH(cfn);
if (swtch) {
bool active = getSwitch(swtch, 0);
// Handle case where function is disabled while active
if (CFN_ACTIVE(cfn) == 0)
active = false;
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
// 'No Keys' function checks both switch states
if (CFN_FUNC(cfn) == FUNC_DISABLE_KEYS) {
if (active != isFunctionActive(FUNCTION_DISABLE_KEYS))
setKeyLockedState(active);
if (active)
newActiveFunctions |= (1u << FUNCTION_DISABLE_KEYS);
}
#endif
#if defined(HARDWARE_TOUCH)
if (CFN_FUNC(cfn) == FUNC_DISABLE_TOUCH) {
if (active != isFunctionActive(FUNCTION_DISABLE_TOUCH))
POPUP_BUBBLE(active ? STR_TOUCH_DISABLED : STR_TOUCH_ENABLED, 1500, DEFAULT_BUBBLE_WIDTH, DEFAULT_BUBBLE_Y-BUBBLE_HEIGHT);
if (active)
newActiveFunctions |= (1u << FUNCTION_DISABLE_TOUCH);
}
#endif
if (active) {
switch (CFN_FUNC(cfn)) {
case FUNC_LOGS:
if (CFN_PARAM(cfn)) {
newActiveFunctions |= (1u << FUNCTION_LOGS);
logDelay100ms = CFN_PARAM(cfn); // logging period is 0..25.5s in 100ms increments
}
break;
case FUNC_SET_SCREEN:
if (isRepeatDelayElapsed(functions, functionsContext, i)) {
#if defined(COLORLCD)
extern void setRequestedMainView(uint8_t view);
setRequestedMainView(max(0, CFN_PARAM(cfn) - 1));
#else
extern void showTelemScreen(uint8_t index);
showTelemScreen(CFN_PARAM(cfn));
#endif
}
break;
case FUNC_SCREENSHOT:
// Use 'repeat' property to ensure single activation (repeat defaults to 1x)
if (isRepeatDelayElapsed(functions, functionsContext, i)) {
writeScreenshot();
}
break;
case FUNC_RESET:
if (CFN_PARAM(cfn) == FUNC_RESET_FLIGHT) {
// Use 'repeat' property to ensure single activation (repeat defaults to 1x)
if (isRepeatDelayElapsed(functions, functionsContext, i)) {
flightReset();
}
}
break;
case FUNC_BACKLIGHT: {
newActiveFunctions |= (1u << FUNCTION_BACKLIGHT);
if (!CFN_PARAM(cfn)) { // When no source is set, backlight works
// like original backlight and turn on
// regardless of backlight settings
requiredBacklightBright = BACKLIGHT_FORCED_ON;
} else {
calcBacklightValue(CFN_PARAM(cfn));
}
break;
}
#if defined(AUDIO)
case FUNC_VOLUME: {
newActiveFunctions |= (1u << FUNCTION_VOLUME);
calcVolumeValue(CFN_PARAM(cfn));
break;
}
#endif
default:
break;
}
newActiveSwitches |= ((MASK_CFN_TYPE)1 << i);
} else {
functionsContext.lastFunctionTime[i] = 0;
}
}
}
functionsContext.activeUIFunctions = newActiveFunctions;
functionsContext.activeUISwitches = newActiveSwitches;
if (!isFunctionActive(FUNCTION_BACKLIGHT)) {
if (g_eeGeneral.backlightSrc && mixerTaskRunning()) {
calcBacklightValue(g_eeGeneral.backlightSrc);
} else {
requiredBacklightBright = g_eeGeneral.getBrightness();
}
}
#if defined(AUDIO)
if (!isFunctionActive(FUNCTION_VOLUME)) {
if (g_eeGeneral.volumeSrc && mixerTaskRunning()) {
calcVolumeValue(g_eeGeneral.volumeSrc);
} else {
requiredSpeakerVolume =
limit<int>(0, g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF, VOLUME_LEVEL_MAX);
}
}
#endif
}
const char* funcGetLabel(uint8_t func)
{
switch(func) {
@@ -570,6 +660,10 @@ const char* funcGetLabel(uint8_t func)
#if defined(COLORLCD)
case FUNC_DISABLE_TOUCH:
return STR_SF_DISABLE_TOUCH;
#endif
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
case FUNC_DISABLE_KEYS:
return STR_SF_DISABLE_KEYS;
#endif
case FUNC_SET_SCREEN:
return STR_SF_SET_SCREEN;
-8
View File
@@ -55,14 +55,6 @@ extern uint8_t requiredSpeakerVolume;
extern uint8_t requiredBacklightBright;
enum MainRequest {
REQUEST_SCREENSHOT,
REQUEST_FLIGHT_RESET,
REQUEST_MAIN_VIEW,
};
extern uint8_t mainRequestFlags;
PACK(struct MixState {
uint16_t delay:14; // max = 2550
uint8_t activeMix:1;
@@ -203,11 +203,11 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
case 0:
if (sub==k && menuHorizontalPosition < 1 && CFN_SWITCH(cfn) == SWSRC_NONE) {
CFN_ACTIVE(cfn) = 0; // Default is disabled
drawSwitch(MODEL_SPECIAL_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | INVERS | ((functionsContext->activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
drawSwitch(MODEL_SPECIAL_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | INVERS | (functionsContext->isFunctionSwitchActive(k) ? BOLD : 0));
if (active) CHECK_INCDEC_SWITCH(event, CFN_SWITCH(cfn), SWSRC_FIRST, SWSRC_LAST, eeFlags, isSwitchAvailableInCustomFunctions);
}
else {
drawSwitch(MODEL_SPECIAL_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | ((functionsContext->activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
drawSwitch(MODEL_SPECIAL_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | (functionsContext->isFunctionSwitchActive(k) ? BOLD : 0));
if (active || AUTOSWITCH_ENTER_LONG()) {
if (event == EVT_KEY_LONG(KEY_ENTER))
killEvents(event);
@@ -197,7 +197,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
switch (j) {
case ITEM_CUSTOM_FUNCTIONS_SWITCH:
if(CFN_SWITCH(cfn) == SWSRC_NONE) CFN_ACTIVE(cfn) = 0; // Disable new function by default
drawSwitch(MODEL_SPECIAL_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | ((functionsContext->activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
drawSwitch(MODEL_SPECIAL_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | (functionsContext->isFunctionSwitchActive(k) ? BOLD : 0));
if (active || AUTOSWITCH_ENTER_LONG()) {
if (event == EVT_KEY_LONG(KEY_ENTER))
killEvents(event);
+3
View File
@@ -199,6 +199,9 @@ extern "C" void touchDriverRead(lv_indev_drv_t *drv, lv_indev_data_t *data)
// no touch input if special function is used
if (isFunctionActive(FUNCTION_DISABLE_TOUCH)) {
lv_indev_reset(touchDevice, nullptr);
if (st.event != TE_NONE) {
POPUP_BUBBLE(STR_TOUCH_DISABLED, 1500, DEFAULT_BUBBLE_WIDTH, DEFAULT_BUBBLE_Y-BUBBLE_HEIGHT);
}
return;
}
+4 -4
View File
@@ -116,8 +116,8 @@ static lv_obj_t* bubble_popup_create(lv_obj_t* parent)
class BubbleDialog : public Window
{
public:
BubbleDialog(const char* message, int timeout, coord_t width) :
Window(MainWindow::instance(), rect_t{(LCD_W - width) / 2, LCD_H - 100, width, 50},
BubbleDialog(const char* message, int timeout, coord_t width, coord_t y) :
Window(MainWindow::instance(), rect_t{(LCD_W - width) / 2, y, width, BUBBLE_HEIGHT},
bubble_popup_create),
startTime(lv_tick_get()), timeout(timeout)
{
@@ -147,7 +147,7 @@ class BubbleDialog : public Window
uint32_t timeout;
};
void POPUP_BUBBLE(const char* message, uint32_t timeout, coord_t width)
void POPUP_BUBBLE(const char* message, uint32_t timeout, coord_t width, coord_t y)
{
new BubbleDialog(message, timeout, width);
new BubbleDialog(message, timeout, width, y);
}
+6 -1
View File
@@ -23,6 +23,7 @@
#include <functional>
#include "edgetx_types.h"
#include "etx_lv_theme.h"
#include "hal.h"
enum WarningType
@@ -38,9 +39,13 @@ enum WarningType
typedef std::function<void(const char *, const char *, int, int)>
ProgressHandler;
constexpr coord_t DEFAULT_BUBBLE_WIDTH = LCD_W * 3 / 4;
constexpr coord_t DEFAULT_BUBBLE_Y = LCD_H * 7 / 10;
LAYOUT_VAL_SCALED(BUBBLE_HEIGHT, 50)
void POPUP_INFORMATION(const char *message);
void POPUP_WARNING(const char *message, const char *info = nullptr);
bool POPUP_WARNING_ON_UI_TASK(const char *message, const char *info = nullptr);
void POPUP_BUBBLE(const char *message, uint32_t timeout, coord_t width = LCD_W - 100);
void POPUP_BUBBLE(const char *message, uint32_t timeout, coord_t width = DEFAULT_BUBBLE_WIDTH, coord_t y = DEFAULT_BUBBLE_Y);
void show_ui_popup();
@@ -144,7 +144,14 @@ void ViewMain::setCurrentMainView(unsigned viewId)
lv_obj_set_tile_id(tile_view, viewId, 0, LV_ANIM_OFF);
}
void setRequestedMainView(uint8_t view) { g_model.view = view; }
void setRequestedMainView(uint8_t view)
{
auto viewMain = ViewMain::instance();
if (view < viewMain->getMainViewsCount()) {
viewMain->setCurrentMainView(view);
saveViewId(view);
}
}
void ViewMain::nextMainView()
{
+385 -372
View File
@@ -290,413 +290,426 @@ static const lv_coord_t row_dsc[] = {LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
#define PUSH_CS_DURATION_MIN 0 // 0 no duration : as long as switch is true
#define PUSH_CS_DURATION_MAX 255 // 25.5s longest duration
FunctionEditPage::FunctionEditPage(uint8_t index, EdgeTxIcon icon,
const char *title, const char *prefix) :
Page(icon), index(index)
class FunctionEditPage : public Page
{
buildHeader(header, title, prefix);
delayLoad();
}
void FunctionEditPage::delayedInit()
{
buildBody(body);
}
void FunctionEditPage::checkEvents()
{
Page::checkEvents();
if (active != isActive()) {
if (isActive()) {
lv_obj_add_state(headerSF->getLvObj(), ETX_STATE_SF_ACTIVE);
} else {
lv_obj_clear_state(headerSF->getLvObj(), ETX_STATE_SF_ACTIVE);
}
active = isActive();
public:
FunctionEditPage(uint8_t index, EdgeTxIcon icon, const char *title,
const char *prefix) : Page(icon), index(index)
{
buildHeader(header, title, prefix);
delayLoad();
}
}
void FunctionEditPage::buildHeader(Window *window, const char *title,
const char *prefix)
{
header->setTitle(title);
headerSF = header->setTitle2(prefix + std::to_string(index + 1));
void delayedInit() override
{
buildBody(body);
}
etx_txt_color(headerSF->getLvObj(), COLOR_THEME_ACTIVE_INDEX,
ETX_STATE_SF_ACTIVE);
etx_font(headerSF->getLvObj(), FONT_BOLD_INDEX, ETX_STATE_SF_ACTIVE);
}
protected:
uint8_t index;
Window *specialFunctionOneWindow = nullptr;
StaticText *headerSF = nullptr;
bool active = false;
bool saveKeyLockState;
void FunctionEditPage::addSourceChoice(FormLine *line, const char *title,
CustomFunctionData *cfn, int16_t vmax)
{
new StaticText(line, rect_t{}, title);
new SourceChoice(line, rect_t{}, 0, vmax, GET_SET_DEFAULT(CFN_PARAM(cfn)), true);
}
virtual bool isActive() const = 0;
virtual bool isSwitchAvailable(int value) const = 0;
virtual CustomFunctionData *customFunctionData() const = 0;
virtual bool isAssignableFunctionAvailable(int function) const = 0;
virtual void setDirty() const = 0;
NumberEdit *FunctionEditPage::addNumberEdit(FormLine *line, const char *title,
CustomFunctionData *cfn,
int16_t vmin, int16_t vmax)
{
new StaticText(line, rect_t{}, title);
return new NumberEdit(line, rect_t{}, vmin, vmax,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
}
void FunctionEditPage::updateSpecialFunctionOneWindow()
{
specialFunctionOneWindow->clear();
specialFunctionOneWindow->setFlexLayout();
FlexGridLayout grid(col_dsc, row_dsc, PAD_TINY);
auto line = specialFunctionOneWindow->newLine(grid);
CustomFunctionData *cfn = customFunctionData();
uint8_t func = CFN_FUNC(cfn);
// Func param
switch (func) {
case FUNC_OVERRIDE_CHANNEL: {
new StaticText(line, rect_t{}, STR_CH);
new NumberEdit(line, rect_t{}, 1, MAX_OUTPUT_CHANNELS,
GET_SET_VALUE_WITH_OFFSET(CFN_CH_INDEX(cfn), 1));
line = specialFunctionOneWindow->newLine(grid);
int limit =
(g_model.extendedLimits ? LIMIT_EXT_PERCENT : LIMIT_STD_PERCENT);
addNumberEdit(line, STR_VALUE, cfn, -limit, limit);
break;
}
case FUNC_TRAINER: {
new StaticText(line, rect_t{}, STR_VALUE);
auto max_sticks = adcGetMaxInputs(ADC_INPUT_MAIN);
auto choice = new Choice(line, rect_t{}, 0, max_sticks + 1,
GET_SET_DEFAULT(CFN_CH_INDEX(cfn)));
choice->setTextHandler([=](int32_t value) {
if (value == 0)
return std::string(STR_STICKS);
else if (value == MAX_STICKS + 1)
return std::string(STR_CHANS);
return std::string(getMainControlLabel(value - 1));
});
break;
}
case FUNC_RESET:
if (CFN_PARAM(cfn) <= FUNC_RESET_PARAM_LAST) {
new StaticText(line, rect_t{}, STR_RESET);
auto choice =
new Choice(line, rect_t{}, 0,
FUNC_RESET_PARAM_FIRST_TELEM + lastUsedTelemetryIndex(),
GET_SET_DEFAULT(CFN_PARAM(cfn)));
choice->setAvailableHandler(isSourceAvailableInResetSpecialFunction);
choice->setTextHandler([=](int32_t value) {
if (value < FUNC_RESET_PARAM_FIRST_TELEM)
return std::string(STR_VFSWRESET[value]);
else
return std::string(
g_model.telemetrySensors[value - FUNC_RESET_PARAM_FIRST_TELEM]
.label,
TELEM_LABEL_LEN);
});
}
break;
case FUNC_VOLUME:
addSourceChoice(line, STR_VOLUME, cfn, MIXSRC_LAST_CH);
break;
case FUNC_BACKLIGHT:
addSourceChoice(line, STR_VALUE, cfn, MIXSRC_LAST_CH);
break;
case FUNC_PLAY_SOUND:
new StaticText(line, rect_t{}, STR_VALUE);
new Choice(line, rect_t{}, STR_FUNCSOUNDS, 0,
AU_SPECIAL_SOUND_LAST - AU_SPECIAL_SOUND_FIRST - 1,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
break;
case FUNC_PLAY_TRACK:
case FUNC_BACKGND_MUSIC:
case FUNC_PLAY_SCRIPT:
case FUNC_RGB_LED:
new StaticText(line, rect_t{}, STR_VALUE);
new FileChoice(
line, rect_t{},
func == FUNC_PLAY_SCRIPT || func == FUNC_RGB_LED
? (func == FUNC_PLAY_SCRIPT ? SCRIPTS_FUNCS_PATH
: SCRIPTS_RGB_PATH)
: std::string(SOUNDS_PATH, SOUNDS_PATH_LNG_OFS) +
std::string(currentLanguagePack->id, 2),
(func == FUNC_PLAY_SCRIPT || func == FUNC_RGB_LED) ? SCRIPTS_EXT
: SOUNDS_EXT,
sizeof(cfn->play.name),
[=]() { return std::string(cfn->play.name, ZLEN(cfn->play.name)); },
[=](std::string newValue) {
strncpy(cfn->play.name, newValue.c_str(), sizeof(cfn->play.name));
SET_DIRTY();
if (func == FUNC_PLAY_SCRIPT || func == FUNC_RGB_LED)
LUA_LOAD_MODEL_SCRIPTS();
},
true, funcGetLabel(func));
break;
case FUNC_SET_TIMER: {
new StaticText(line, rect_t{}, STR_TIMER);
if (timersSetupCount() > 0) {
auto timerchoice = new Choice(line, rect_t{}, 0, TIMERS - 1,
GET_SET_DEFAULT(CFN_TIMER_INDEX(cfn)));
timerchoice->setTextHandler([](int32_t value) {
return std::string(STR_TIMER) + std::to_string(value + 1);
});
timerchoice->setAvailableHandler(
[=](int value) { return isTimerSourceAvailable(value); });
line = specialFunctionOneWindow->newLine(grid);
new StaticText(line, rect_t{}, STR_VALUE);
new TimeEdit(line, rect_t{}, 0, 9 * 60 * 60 - 1,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
void checkEvents() override
{
Page::checkEvents();
if (active != isActive()) {
if (isActive()) {
lv_obj_add_state(headerSF->getLvObj(), ETX_STATE_SF_ACTIVE);
} else {
new StaticText(line, rect_t{}, STR_NO_TIMERS);
lv_obj_clear_state(headerSF->getLvObj(), ETX_STATE_SF_ACTIVE);
}
break;
active = isActive();
}
}
static const char* const strModules[] = { "Int.", "Ext." };
case FUNC_SET_FAILSAFE:
new StaticText(line, rect_t{}, STR_MODULE);
new Choice(line, rect_t{}, strModules, 0, NUM_MODULES - 1,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
break;
void addSourceChoice(FormLine *line, const char *title,
CustomFunctionData *cfn, int16_t vmax)
{
new StaticText(line, rect_t{}, title);
new SourceChoice(line, rect_t{}, 0, vmax, GET_SET_DEFAULT(CFN_PARAM(cfn)), true);
}
case FUNC_PLAY_VALUE:
addSourceChoice(line, STR_VALUE, cfn, MIXSRC_LAST_TELEM);
break;
NumberEdit *addNumberEdit(FormLine *line, const char *title,
CustomFunctionData *cfn, int16_t vmin, int16_t vmax)
{
new StaticText(line, rect_t{}, title);
return new NumberEdit(line, rect_t{}, vmin, vmax,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
}
case FUNC_HAPTIC:
addNumberEdit(line, STR_VALUE, cfn, 0, 3);
break;
void updateSpecialFunctionOneWindow()
{
specialFunctionOneWindow->clear();
specialFunctionOneWindow->setFlexLayout();
FlexGridLayout grid(col_dsc, row_dsc, PAD_TINY);
auto line = specialFunctionOneWindow->newLine(grid);
#if defined(FUNCTION_SWITCHES)
case FUNC_PUSH_CUST_SWITCH: {
new StaticText(line, rect_t{}, STR_SWITCH);
auto choice = new Choice(line, rect_t{}, 0, switchGetMaxSwitches() - 1,
[=]() { return switchGetSwitchFromCustomIdx(CFN_CS_INDEX(cfn)); },
[=](int n) { CFN_CS_INDEX(cfn) = switchGetCustomSwitchIdx(n); },
STR_SWITCH);
choice->setTextHandler([=](int n) {
return std::string(switchGetDefaultName(n));
});
choice->setAvailableHandler(switchIsCustomSwitch);
CustomFunctionData *cfn = customFunctionData();
uint8_t func = CFN_FUNC(cfn);
// Func param
switch (func) {
case FUNC_OVERRIDE_CHANNEL: {
new StaticText(line, rect_t{}, STR_CH);
new NumberEdit(line, rect_t{}, 1, MAX_OUTPUT_CHANNELS,
GET_SET_VALUE_WITH_OFFSET(CFN_CH_INDEX(cfn), 1));
line = specialFunctionOneWindow->newLine(grid);
auto edit = addNumberEdit(line, STR_INTERVAL, cfn, PUSH_CS_DURATION_MIN,
PUSH_CS_DURATION_MAX);
int limit =
(g_model.extendedLimits ? LIMIT_EXT_PERCENT : LIMIT_STD_PERCENT);
addNumberEdit(line, STR_VALUE, cfn, -limit, limit);
break;
}
case FUNC_TRAINER: {
new StaticText(line, rect_t{}, STR_VALUE);
auto max_sticks = adcGetMaxInputs(ADC_INPUT_MAIN);
auto choice = new Choice(line, rect_t{}, 0, max_sticks + 1,
GET_SET_DEFAULT(CFN_CH_INDEX(cfn)));
choice->setTextHandler([=](int32_t value) {
if (value == 0)
return std::string(STR_STICKS);
else if (value == max_sticks + 1)
return std::string(STR_CHANS);
return std::string(getMainControlLabel(value - 1));
});
break;
}
case FUNC_RESET:
if (CFN_PARAM(cfn) <= FUNC_RESET_PARAM_LAST) {
new StaticText(line, rect_t{}, STR_RESET);
auto choice =
new Choice(line, rect_t{}, 0,
FUNC_RESET_PARAM_FIRST_TELEM + lastUsedTelemetryIndex(),
GET_SET_DEFAULT(CFN_PARAM(cfn)));
choice->setAvailableHandler(isSourceAvailableInResetSpecialFunction);
choice->setTextHandler([=](int32_t value) {
if (value < FUNC_RESET_PARAM_FIRST_TELEM)
return std::string(STR_VFSWRESET[value]);
else
return std::string(
g_model.telemetrySensors[value - FUNC_RESET_PARAM_FIRST_TELEM]
.label,
TELEM_LABEL_LEN);
});
}
break;
case FUNC_VOLUME:
addSourceChoice(line, STR_VOLUME, cfn, MIXSRC_LAST_CH);
break;
case FUNC_BACKLIGHT:
addSourceChoice(line, STR_VALUE, cfn, MIXSRC_LAST_CH);
break;
case FUNC_PLAY_SOUND:
new StaticText(line, rect_t{}, STR_VALUE);
new Choice(line, rect_t{}, STR_FUNCSOUNDS, 0,
AU_SPECIAL_SOUND_LAST - AU_SPECIAL_SOUND_FIRST - 1,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
break;
case FUNC_PLAY_TRACK:
case FUNC_BACKGND_MUSIC:
case FUNC_PLAY_SCRIPT:
case FUNC_RGB_LED:
new StaticText(line, rect_t{}, STR_VALUE);
new FileChoice(
line, rect_t{},
func == FUNC_PLAY_SCRIPT || func == FUNC_RGB_LED
? (func == FUNC_PLAY_SCRIPT ? SCRIPTS_FUNCS_PATH
: SCRIPTS_RGB_PATH)
: std::string(SOUNDS_PATH, SOUNDS_PATH_LNG_OFS) +
std::string(currentLanguagePack->id, 2),
(func == FUNC_PLAY_SCRIPT || func == FUNC_RGB_LED) ? SCRIPTS_EXT
: SOUNDS_EXT,
sizeof(cfn->play.name),
[=]() { return std::string(cfn->play.name, ZLEN(cfn->play.name)); },
[=](std::string newValue) {
strncpy(cfn->play.name, newValue.c_str(), sizeof(cfn->play.name));
SET_DIRTY();
if (func == FUNC_PLAY_SCRIPT || func == FUNC_RGB_LED)
LUA_LOAD_MODEL_SCRIPTS();
},
true, funcGetLabel(func));
break;
case FUNC_SET_TIMER: {
new StaticText(line, rect_t{}, STR_TIMER);
if (timersSetupCount() > 0) {
auto timerchoice = new Choice(line, rect_t{}, 0, TIMERS - 1,
GET_SET_DEFAULT(CFN_TIMER_INDEX(cfn)));
timerchoice->setTextHandler([](int32_t value) {
return std::string(STR_TIMER) + std::to_string(value + 1);
});
timerchoice->setAvailableHandler(
[=](int value) { return isTimerSourceAvailable(value); });
line = specialFunctionOneWindow->newLine(grid);
new StaticText(line, rect_t{}, STR_VALUE);
new TimeEdit(line, rect_t{}, 0, 9 * 60 * 60 - 1,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
} else {
new StaticText(line, rect_t{}, STR_NO_TIMERS);
}
break;
}
case FUNC_SET_FAILSAFE:
static const char* const strModules[] = { "Int.", "Ext." };
new StaticText(line, rect_t{}, STR_MODULE);
new Choice(line, rect_t{}, strModules, 0, NUM_MODULES - 1,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
break;
case FUNC_PLAY_VALUE:
addSourceChoice(line, STR_VALUE, cfn, MIXSRC_LAST_TELEM);
break;
case FUNC_HAPTIC:
addNumberEdit(line, STR_VALUE, cfn, 0, 3);
break;
#if defined(FUNCTION_SWITCHES)
case FUNC_PUSH_CUST_SWITCH: {
new StaticText(line, rect_t{}, STR_SWITCH);
auto choice = new Choice(line, rect_t{}, 0, switchGetMaxSwitches() - 1,
[=]() { return switchGetSwitchFromCustomIdx(CFN_CS_INDEX(cfn)); },
[=](int n) { CFN_CS_INDEX(cfn) = switchGetCustomSwitchIdx(n); },
STR_SWITCH);
choice->setTextHandler([=](int n) {
return std::string(switchGetDefaultName(n));
});
choice->setAvailableHandler(switchIsCustomSwitch);
line = specialFunctionOneWindow->newLine(grid);
auto edit = addNumberEdit(line, STR_INTERVAL, cfn, PUSH_CS_DURATION_MIN,
PUSH_CS_DURATION_MAX);
edit->setDisplayHandler([=](int32_t value) {
return formatNumberAsString(CFN_PARAM(cfn), PREC1, 0, nullptr, "s");
});
}
break;
#endif
case FUNC_LOGS: {
if (CFN_PARAM(cfn) == 0) // use stored value if SF exists
CFN_PARAM(cfn) = SD_LOGS_PERIOD_DEFAULT; // otherwise initialize with
// default value
auto edit = addNumberEdit(line, STR_INTERVAL, cfn, SD_LOGS_PERIOD_MIN,
SD_LOGS_PERIOD_MAX);
edit->setDefault(
SD_LOGS_PERIOD_DEFAULT); // set default period for DEF button
edit->setDisplayHandler([=](int32_t value) {
return formatNumberAsString(CFN_PARAM(cfn), PREC1, 0, nullptr, "s");
});
break;
}
break;
#endif
case FUNC_LOGS: {
if (CFN_PARAM(cfn) == 0) // use stored value if SF exists
CFN_PARAM(cfn) = SD_LOGS_PERIOD_DEFAULT; // otherwise initialize with
// default value
case FUNC_SET_SCREEN:
CFN_PARAM(cfn) = (int16_t)max(CFN_PARAM(cfn), (int16_t)1);
CFN_PARAM(cfn) = (int16_t)min(
CFN_PARAM(cfn), (int16_t)ViewMain::instance()->getMainViewsCount());
addNumberEdit(line, STR_VALUE, cfn, 1,
ViewMain::instance()->getMainViewsCount());
break;
auto edit = addNumberEdit(line, STR_INTERVAL, cfn, SD_LOGS_PERIOD_MIN,
SD_LOGS_PERIOD_MAX);
edit->setDefault(
SD_LOGS_PERIOD_DEFAULT); // set default period for DEF button
edit->setDisplayHandler([=](int32_t value) {
return formatNumberAsString(CFN_PARAM(cfn), PREC1, 0, nullptr, "s");
});
break;
}
case FUNC_ADJUST_GVAR: {
if (validateSFGV(cfn)) SET_DIRTY();
new StaticText(line, rect_t{}, STR_GLOBALVAR);
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
GET_DEFAULT(CFN_GVAR_INDEX(cfn)),
[=](int32_t newValue){
CFN_GVAR_INDEX(cfn) = newValue;
SET_DIRTY();
updateSpecialFunctionOneWindow();
});
gvarchoice->setTextHandler([](int32_t value) {
return std::string(getSourceString(value + MIXSRC_FIRST_GVAR));
});
line = specialFunctionOneWindow->newLine(grid);
case FUNC_SET_SCREEN:
CFN_PARAM(cfn) = (int16_t)max(CFN_PARAM(cfn), (int16_t)1);
CFN_PARAM(cfn) = (int16_t)min(
CFN_PARAM(cfn), (int16_t)ViewMain::instance()->getMainViewsCount());
addNumberEdit(line, STR_VALUE, cfn, 1,
ViewMain::instance()->getMainViewsCount());
break;
new StaticText(line, rect_t{}, STR_MODE);
auto modechoice = new Choice(line, rect_t{}, FUNC_ADJUST_GVAR_CONSTANT,
FUNC_ADJUST_GVAR_INCDEC,
GET_DEFAULT(CFN_GVAR_MODE(cfn)),
[=](int32_t newValue) {
CFN_GVAR_MODE(cfn) = newValue;
CFN_PARAM(cfn) = 0;
SET_DIRTY();
updateSpecialFunctionOneWindow();
});
line = specialFunctionOneWindow->newLine(grid);
case FUNC_ADJUST_GVAR: {
if (validateSFGV(cfn)) SET_DIRTY();
new StaticText(line, rect_t{}, STR_GLOBALVAR);
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
GET_DEFAULT(CFN_GVAR_INDEX(cfn)),
[=](int32_t newValue){
CFN_GVAR_INDEX(cfn) = newValue;
SET_DIRTY();
updateSpecialFunctionOneWindow();
});
gvarchoice->setTextHandler([](int32_t value) {
return std::string(getSourceString(value + MIXSRC_FIRST_GVAR));
});
line = specialFunctionOneWindow->newLine(grid);
modechoice->setTextHandler([](int32_t value) {
switch (value) {
case FUNC_ADJUST_GVAR_CONSTANT:
return std::string(STR_CONSTANT);
case FUNC_ADJUST_GVAR_SOURCE:
return std::string(STR_MIXSOURCE);
case FUNC_ADJUST_GVAR_SOURCERAW:
return std::string(STR_MIXSOURCERAW);
case FUNC_ADJUST_GVAR_GVAR:
return std::string(STR_GLOBALVAR);
case FUNC_ADJUST_GVAR_INCDEC:
return std::string(STR_INCDEC);
}
return std::string("---");
});
new StaticText(line, rect_t{}, STR_MODE);
auto modechoice = new Choice(line, rect_t{}, FUNC_ADJUST_GVAR_CONSTANT,
FUNC_ADJUST_GVAR_INCDEC,
GET_DEFAULT(CFN_GVAR_MODE(cfn)),
[=](int32_t newValue) {
CFN_GVAR_MODE(cfn) = newValue;
CFN_PARAM(cfn) = 0;
SET_DIRTY();
updateSpecialFunctionOneWindow();
});
line = specialFunctionOneWindow->newLine(grid);
modechoice->setTextHandler([](int32_t value) {
switch (value) {
case FUNC_ADJUST_GVAR_CONSTANT:
return std::string(STR_CONSTANT);
switch (CFN_GVAR_MODE(cfn)) {
case FUNC_ADJUST_GVAR_CONSTANT: {
int16_t val_min, val_max;
getMixSrcRange(CFN_GVAR_INDEX(cfn) + MIXSRC_FIRST_GVAR, val_min,
val_max);
addNumberEdit(line, STR_CONSTANT, cfn, val_min, val_max);
break;
}
case FUNC_ADJUST_GVAR_SOURCE:
return std::string(STR_MIXSOURCE);
case FUNC_ADJUST_GVAR_SOURCERAW:
return std::string(STR_MIXSOURCERAW);
case FUNC_ADJUST_GVAR_GVAR:
return std::string(STR_GLOBALVAR);
case FUNC_ADJUST_GVAR_INCDEC:
return std::string(STR_INCDEC);
}
return std::string("---");
});
switch (CFN_GVAR_MODE(cfn)) {
case FUNC_ADJUST_GVAR_CONSTANT: {
int16_t val_min, val_max;
getMixSrcRange(CFN_GVAR_INDEX(cfn) + MIXSRC_FIRST_GVAR, val_min,
val_max);
addNumberEdit(line, STR_CONSTANT, cfn, val_min, val_max);
break;
}
case FUNC_ADJUST_GVAR_SOURCE:
case FUNC_ADJUST_GVAR_SOURCERAW:
addSourceChoice(line, STR_MIXSOURCE, cfn, MIXSRC_LAST_CH);
break;
case FUNC_ADJUST_GVAR_GVAR: {
new StaticText(line, rect_t{}, STR_GLOBALVAR);
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
gvarchoice->setTextHandler([](int32_t value) {
return std::string(getSourceString(value + MIXSRC_FIRST_GVAR));
});
gvarchoice->setAvailableHandler(
[=](int value) { return CFN_GVAR_INDEX(cfn) != value; });
break;
}
case FUNC_ADJUST_GVAR_INCDEC: {
int16_t val_min, val_max;
getMixSrcRange(CFN_GVAR_INDEX(cfn) + MIXSRC_FIRST_GVAR, val_min,
val_max);
getGVarIncDecRange(val_min, val_max);
auto numedit = addNumberEdit(line, STR_INCDEC, cfn, val_min, val_max);
numedit->setDisplayHandler([](int value) {
return formatNumberAsString(abs(value), 0, 0,
value >= 0 ? "+=" : "-=", nullptr);
});
break;
addSourceChoice(line, STR_MIXSOURCE, cfn, MIXSRC_LAST_CH);
break;
case FUNC_ADJUST_GVAR_GVAR: {
new StaticText(line, rect_t{}, STR_GLOBALVAR);
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
gvarchoice->setTextHandler([](int32_t value) {
return std::string(getSourceString(value + MIXSRC_FIRST_GVAR));
});
gvarchoice->setAvailableHandler(
[=](int value) { return CFN_GVAR_INDEX(cfn) != value; });
break;
}
case FUNC_ADJUST_GVAR_INCDEC: {
int16_t val_min, val_max;
getMixSrcRange(CFN_GVAR_INDEX(cfn) + MIXSRC_FIRST_GVAR, val_min,
val_max);
getGVarIncDecRange(val_min, val_max);
auto numedit = addNumberEdit(line, STR_INCDEC, cfn, val_min, val_max);
numedit->setDisplayHandler([](int value) {
return formatNumberAsString(abs(value), 0, 0,
value >= 0 ? "+=" : "-=", nullptr);
});
break;
}
}
}
}
}
if (HAS_REPEAT_PARAM(func)) { // !1x 1x 1s 2s 3s ...
if (HAS_REPEAT_PARAM(func)) { // !1x 1x 1s 2s 3s ...
line = specialFunctionOneWindow->newLine(grid);
new StaticText(line, rect_t{}, STR_REPEAT);
if (func == FUNC_PLAY_SCRIPT || func == FUNC_RGB_LED) {
auto repeat = new Choice(line, rect_t{}, 0, 1,
GET_DEFAULT((int8_t)CFN_PLAY_REPEAT(cfn)),
SET_DEFAULT(CFN_PLAY_REPEAT(cfn)));
repeat->setTextHandler([](int32_t value) {
// 0 == repeat at 50ms interval for backward compatibility
return (value == 0) ? std::string("On") : std::string("1x");
});
} else {
auto repeat = new NumberEdit(line, rect_t{}, -1, 60 / CFN_PLAY_REPEAT_MUL,
GET_DEFAULT((int8_t)CFN_PLAY_REPEAT(cfn)),
SET_DEFAULT(CFN_PLAY_REPEAT(cfn)));
repeat->setDisplayHandler([](int32_t value) {
if (value == 0)
return std::string("1x");
else if (value == (int8_t)CFN_PLAY_REPEAT_NOSTART)
return std::string("!1x");
else {
return formatNumberAsString(value * CFN_PLAY_REPEAT_MUL, 0, 0,
nullptr, "s");
}
});
}
}
line = specialFunctionOneWindow->newLine(grid);
new StaticText(line, rect_t{}, STR_REPEAT);
if (func == FUNC_PLAY_SCRIPT || func == FUNC_RGB_LED) {
auto repeat = new Choice(line, rect_t{}, 0, 1,
GET_DEFAULT((int8_t)CFN_PLAY_REPEAT(cfn)),
SET_DEFAULT(CFN_PLAY_REPEAT(cfn)));
repeat->setTextHandler([](int32_t value) {
// 0 == repeat at 50ms interval for backward compatibility
return (value == 0) ? std::string("On") : std::string("1x");
});
} else {
auto repeat = new NumberEdit(line, rect_t{}, -1, 60 / CFN_PLAY_REPEAT_MUL,
GET_DEFAULT((int8_t)CFN_PLAY_REPEAT(cfn)),
SET_DEFAULT(CFN_PLAY_REPEAT(cfn)));
repeat->setDisplayHandler([](int32_t value) {
if (value == 0)
return std::string("1x");
else if (value == (int8_t)CFN_PLAY_REPEAT_NOSTART)
return std::string("!1x");
else {
return formatNumberAsString(value * CFN_PLAY_REPEAT_MUL, 0, 0,
nullptr, "s");
}
});
}
new StaticText(line, rect_t{}, STR_ENABLE);
new ToggleSwitch(line, rect_t{}, GET_DEFAULT(CFN_ACTIVE(cfn)),
[=](int newValue) {
CFN_ACTIVE(cfn) = newValue;
SET_DIRTY();
if (CFN_FUNC(cfn) == FUNC_PLAY_SCRIPT || CFN_FUNC(cfn) == FUNC_RGB_LED)
LUA_LOAD_MODEL_SCRIPTS();
});
}
line = specialFunctionOneWindow->newLine(grid);
new StaticText(line, rect_t{}, STR_ENABLE);
new ToggleSwitch(line, rect_t{}, GET_DEFAULT(CFN_ACTIVE(cfn)),
[=](int newValue) {
CFN_ACTIVE(cfn) = newValue;
SET_DIRTY();
if (CFN_FUNC(cfn) == FUNC_PLAY_SCRIPT || CFN_FUNC(cfn) == FUNC_RGB_LED)
LUA_LOAD_MODEL_SCRIPTS();
});
}
void buildHeader(Window *window, const char *title, const char *prefix)
{
header->setTitle(title);
headerSF = header->setTitle2(prefix + std::to_string(index + 1));
void FunctionEditPage::buildBody(Window *form)
{
form->setFlexLayout(LV_FLEX_FLOW_COLUMN, PAD_LARGE);
FlexGridLayout grid(col_dsc, row_dsc, PAD_TINY);
CustomFunctionData *cfn = customFunctionData();
// Switch
auto line = form->newLine(grid);
new StaticText(line, rect_t{}, STR_SF_SWITCH);
auto switchChoice = new SwitchChoice(line, rect_t{}, SWSRC_FIRST, SWSRC_LAST,
GET_SET_DEFAULT(CFN_SWITCH(cfn)));
switchChoice->setAvailableHandler(
[=](int value) { return isSwitchAvailable(value); });
// Patch function in case not available
if (!isAssignableFunctionAvailable(CFN_FUNC(cfn))) {
auto func = 0;
while (!isAssignableFunctionAvailable(func) && (func < FUNC_MAX - 1)) {
func++;
}
if (func < FUNC_MAX - 1) {
CFN_FUNC(cfn) = func;
}
etx_txt_color(headerSF->getLvObj(), COLOR_THEME_ACTIVE_INDEX,
ETX_STATE_SF_ACTIVE);
etx_font(headerSF->getLvObj(), FONT_BOLD_INDEX, ETX_STATE_SF_ACTIVE);
}
// Function
line = form->newLine(grid);
new StaticText(line, rect_t{}, STR_FUNC);
auto functionChoice =
new Choice(line, rect_t{}, 0, FUNC_MAX - 1, GET_DEFAULT(getFuncSortIdx(CFN_FUNC(cfn))),
[=](int32_t newValue) {
Functions newFunc = cfn_sorted[newValue];
// If changing from Lua script then reload to remove old reference
if ((CFN_FUNC(cfn) == FUNC_PLAY_SCRIPT || CFN_FUNC(cfn) == FUNC_RGB_LED) && newFunc != FUNC_PLAY_SCRIPT && newFunc != FUNC_RGB_LED)
LUA_LOAD_MODEL_SCRIPTS();
CFN_FUNC(cfn) = newFunc;
CFN_RESET(cfn);
SET_DIRTY();
updateSpecialFunctionOneWindow();
});
functionChoice->setTextHandler([=](int val) { return funcGetLabel(cfn_sorted[val]); });
functionChoice->setAvailableHandler(
[=](int value) { return isAssignableFunctionAvailable(cfn_sorted[value]); });
void buildBody(Window *form)
{
form->setFlexLayout(LV_FLEX_FLOW_COLUMN, PAD_LARGE);
specialFunctionOneWindow = new Window(form, rect_t{});
updateSpecialFunctionOneWindow();
}
FlexGridLayout grid(col_dsc, row_dsc, PAD_TINY);
CustomFunctionData *cfn = customFunctionData();
// Switch
auto line = form->newLine(grid);
new StaticText(line, rect_t{}, STR_SF_SWITCH);
auto switchChoice = new SwitchChoice(line, rect_t{}, SWSRC_FIRST, SWSRC_LAST,
GET_SET_DEFAULT(CFN_SWITCH(cfn)));
switchChoice->setAvailableHandler(
[=](int value) { return isSwitchAvailable(value); });
// Patch function in case not available
if (!isAssignableFunctionAvailable(CFN_FUNC(cfn))) {
auto func = 0;
while (!isAssignableFunctionAvailable(func) && (func < FUNC_MAX - 1)) {
func++;
}
if (func < FUNC_MAX - 1) {
CFN_FUNC(cfn) = func;
}
}
// Function
line = form->newLine(grid);
new StaticText(line, rect_t{}, STR_FUNC);
auto functionChoice =
new Choice(line, rect_t{}, 0, FUNC_MAX - 1, GET_DEFAULT(getFuncSortIdx(CFN_FUNC(cfn))),
[=](int32_t newValue) {
Functions newFunc = cfn_sorted[newValue];
// If changing from Lua script then reload to remove old reference
if ((CFN_FUNC(cfn) == FUNC_PLAY_SCRIPT || CFN_FUNC(cfn) == FUNC_RGB_LED) && newFunc != FUNC_PLAY_SCRIPT && newFunc != FUNC_RGB_LED)
LUA_LOAD_MODEL_SCRIPTS();
CFN_FUNC(cfn) = newFunc;
CFN_RESET(cfn);
SET_DIRTY();
updateSpecialFunctionOneWindow();
});
functionChoice->setTextHandler([=](int val) { return funcGetLabel(cfn_sorted[val]); });
functionChoice->setAvailableHandler(
[=](int value) { return isAssignableFunctionAvailable(cfn_sorted[value]); });
specialFunctionOneWindow = new Window(form, rect_t{});
updateSpecialFunctionOneWindow();
}
};
//-----------------------------------------------------------------------------
@@ -929,7 +942,7 @@ class SpecialFunctionLineButton : public FunctionLineButton
protected:
bool isActive() const override
{
return modelFunctionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << index);
return modelFunctionsContext.isFunctionSwitchActive(index);
}
};
@@ -947,7 +960,7 @@ class SpecialFunctionEditPage : public FunctionEditPage
protected:
bool isActive() const override
{
return modelFunctionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << index);
return modelFunctionsContext.isFunctionSwitchActive(index);
}
bool isSwitchAvailable(int value) const override
@@ -1009,7 +1022,7 @@ class GlobalFunctionLineButton : public FunctionLineButton
protected:
bool isActive() const override
{
return globalFunctionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << index);
return globalFunctionsContext.isFunctionSwitchActive(index);
}
};
@@ -1027,7 +1040,7 @@ class GlobalFunctionEditPage : public FunctionEditPage
protected:
bool isActive() const override
{
return globalFunctionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << index);
return globalFunctionsContext.isFunctionSwitchActive(index);
}
bool isSwitchAvailable(int value) const override
@@ -28,7 +28,6 @@
struct CustomFunctionData;
class FunctionEditPage;
class FunctionLineButton;
class NumberEdit;
//-----------------------------------------------------------------------------
@@ -79,43 +78,6 @@ class FunctionLineButton : public ListLineButton
//-----------------------------------------------------------------------------
class FunctionEditPage : public Page
{
public:
FunctionEditPage(uint8_t index, EdgeTxIcon icon, const char *title,
const char *prefix);
void delayedInit() override;
protected:
uint8_t index;
Window *specialFunctionOneWindow = nullptr;
StaticText *headerSF = nullptr;
bool active = false;
virtual bool isActive() const = 0;
virtual bool isSwitchAvailable(int value) const = 0;
virtual CustomFunctionData *customFunctionData() const = 0;
virtual bool isAssignableFunctionAvailable(int function) const = 0;
virtual void setDirty() const = 0;
void checkEvents() override;
void buildHeader(Window *window, const char *title, const char *prefix);
void addSourceChoice(FormLine *line, const char *title,
CustomFunctionData *cfn, int16_t vmax);
NumberEdit *addNumberEdit(FormLine *line, const char *title,
CustomFunctionData *cfn, int16_t vmin, int16_t vmax);
void updateSpecialFunctionOneWindow();
void buildBody(Window *form);
};
//-----------------------------------------------------------------------------
class FunctionsPage : public PageGroupItem
{
public:
@@ -29,8 +29,6 @@
#include "stamp.h"
#include "theme_manager.h"
extern void checkSpeakerVolume();
constexpr const char* strip_leading_hyphen(const char* str) {
return (str[0] == '-') ? str + 1 : str;
}
@@ -250,10 +250,12 @@ void CLEAR_POPUP()
popupMenuItemsCount = 0;
}
void POPUP_WAIT(const char * s)
void POPUP_WAIT(const char * s, const char * info)
{
warningText = s;
warningInfoText = nullptr;
warningInfoText = info;
warningInfoLength = info ? strlen(info) : 0;
warningInfoFlags = 0;
warningType = WARNING_TYPE_WAIT;
popupFunc = runPopupWarning;
}
+2 -2
View File
@@ -82,7 +82,7 @@ typedef void (* ProgressHandler)(const char *, const char *, int, int);
#if !defined(GUI)
#define DISPLAY_WARNING(...)
inline void POPUP_WAIT(const char * s) { }
inline void POPUP_WAIT(const char * s, const char * = nullptr) { }
inline void POPUP_WARNING(const char *, const char * = nullptr) { }
inline void POPUP_CONFIRMATION(const char * s, PopupMenuHandler handler) { }
inline void POPUP_INPUT(const char * s, PopupFunc func) { }
@@ -90,7 +90,7 @@ typedef void (* ProgressHandler)(const char *, const char *, int, int);
#else
#define DISPLAY_WARNING(evt) (*popupFunc)(evt)
extern void CLEAR_POPUP();
extern void POPUP_WAIT(const char * s);
extern void POPUP_WAIT(const char * s, const char * = nullptr);
extern void POPUP_INFORMATION(const char * s);
extern void POPUP_WARNING(const char * message, const char * info = nullptr);
extern void SET_WARNING_INFO(const char * info, uint8_t length, uint8_t flags);
+4
View File
@@ -662,6 +662,10 @@ bool isAssignableFunctionAvailable(int function, bool modelFunctions)
case FUNC_PUSH_CUST_SWITCH:
return modelFunctions;
#endif
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
case FUNC_DISABLE_KEYS:
return g_eeGeneral.keyLockEnabled;
#endif
default:
return true;
+11 -2
View File
@@ -183,7 +183,7 @@ void Key::killEvents()
static Key keys[MAX_KEYS];
static Key trim_keys[MAX_TRIMS * 2];
#if !defined(BOOT)
#if !defined(BOOT) && defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
// Per-target key combo (from hal.h KEYS_LOCK_KEY1/KEY2) long-pressed together
// toggles a software key lock.
static bool s_keys_locked = false;
@@ -198,9 +198,18 @@ bool consumeKeysLockToggleEvent()
s_keys_lock_notify = false;
return true;
}
void setKeyLockedState(bool state)
{
if (g_eeGeneral.keyLockEnabled && s_keys_locked != state) {
s_keys_locked = state;
s_keys_lock_notify = true;
}
}
#else
bool areKeysLocked() { return false; }
bool consumeKeysLockToggleEvent() { return false; }
void setKeyLockedState(bool state) {}
#endif
/**
@@ -544,7 +553,7 @@ uint8_t keysPollingCycle()
event_t evt = keys[i].input(keys_input & (1 << i));
if (evt) {
evt = keyMapping(evt | i);
#if !defined(BOOT)
#if !defined(BOOT) && defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
if (evt) {
if (!s_keys_locked) {
pushEvent(evt);
+1
View File
@@ -201,6 +201,7 @@ bool rotaryEncoderPollingCycle();
// suppressed; trims/sticks/switches still work.
bool areKeysLocked();
bool consumeKeysLockToggleEvent();
void setKeyLockedState(bool);
#if defined(USE_HATS_AS_KEYS)
void setHatsAsKeys(bool val);
+3
View File
@@ -3296,6 +3296,9 @@ LROT_BEGIN(etxcst, NULL, 0)
LROT_NUMENTRY( FUNC_PUSH_CUST_SWITCH, FUNC_PUSH_CUST_SWITCH )
#endif
LROT_NUMENTRY( FUNC_SET_SCREEN, FUNC_SET_SCREEN )
#if defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)
LROT_NUMENTRY( FUNC_DISABLE_KEYS, FUNC_DISABLE_KEYS )
#endif
#if defined(COLORLCD)
LROT_NUMENTRY( FUNC_DISABLE_TOUCH, FUNC_DISABLE_TOUCH )
+13 -33
View File
@@ -55,7 +55,6 @@ bool hpDetected = false;
uint8_t currentBacklightBright = 0;
uint8_t requiredBacklightBright = 0;
uint8_t mainRequestFlags = 0;
static bool _usbDisabled = false;
@@ -286,6 +285,7 @@ void checkHatsAsKeys()
// Tick count at which to clear our key-lock message. 0 = no message active.
static tmr10ms_t s_keysLockMsgUntil = 0;
static const char* s_keysLockMsg = nullptr;
static const char* s_keysLockInfo = nullptr;
#endif
void checkKeysLock()
@@ -308,7 +308,8 @@ void checkKeysLock()
// couldn't dismiss it. Keep our own deadline and re-arm POPUP_WAIT every
// tick below — that survives other code clearing warningText (e.g. the
// GVAR display in view_main.cpp).
s_keysLockMsg = areKeysLocked() ? lockedMsg : STR_KEYS_UNLOCKED;
s_keysLockMsg = areKeysLocked() ? STR_KEYS_LOCKED : STR_KEYS_UNLOCKED;
s_keysLockInfo = areKeysLocked() ? lockedMsg : nullptr;
s_keysLockMsgUntil = get_tmr10ms() + 150;
#endif
}
@@ -321,10 +322,11 @@ void checkKeysLock()
// may have replaced it in the meantime.
if (warningText == s_keysLockMsg) CLEAR_POPUP();
s_keysLockMsg = nullptr;
s_keysLockInfo = nullptr;
} else {
// Keep the popup fresh every tick — another path (GVAR, etc.) may
// have cleared warningText; just re-arm it.
POPUP_WAIT(s_keysLockMsg);
POPUP_WAIT(s_keysLockMsg, s_keysLockInfo);
}
}
#endif
@@ -402,6 +404,8 @@ void periodicTick()
}
#if defined(GUI) && defined(COLORLCD)
static LAYOUT_VAL_SCALED(GV_POPUP_WIDTH, 200)
void guiMain(event_t evt)
{
#if defined(LUA)
@@ -424,24 +428,6 @@ void guiMain(event_t evt)
}
#endif
bool mainViewRequested = (mainRequestFlags & (1u << REQUEST_MAIN_VIEW));
if (mainViewRequested) {
auto viewMain = ViewMain::instance();
if (g_model.view < viewMain->getMainViewsCount()) {
viewMain->setCurrentMainView(g_model.view);
storageDirty(EE_MODEL);
} else {
g_model.view = viewMain->getCurrentMainView();
}
mainRequestFlags &= ~(1u << REQUEST_MAIN_VIEW);
}
bool screenshotRequested = (mainRequestFlags & (1u << REQUEST_SCREENSHOT));
if (screenshotRequested) {
writeScreenshot();
mainRequestFlags &= ~(1u << REQUEST_SCREENSHOT);
}
// For color screens show a popup deferred from another task
show_ui_popup();
// Show GVAR popup
@@ -452,7 +438,7 @@ void guiMain(event_t evt)
p = strAppend(p, g_model.gvars[gvarLastChanged].name, LEN_GVAR_NAME);
p = strAppend(p, " = ", 3);
p = strAppendSigned(p, GVAR_VALUE(gvarLastChanged, getGVarFlightMode(mixerCurrentFlightMode, gvarLastChanged)));
POPUP_BUBBLE(s, gvarDisplayTimer * 10, 200);
POPUP_BUBBLE(s, gvarDisplayTimer * 10, GV_POPUP_WIDTH);
gvarDisplayTimer = 0;
}
}
@@ -551,11 +537,6 @@ void guiMain(event_t evt)
}
if (refreshNeeded) lcdRefresh();
if (mainRequestFlags & (1u << REQUEST_SCREENSHOT)) {
writeScreenshot();
mainRequestFlags &= ~(1u << REQUEST_SCREENSHOT);
}
}
#endif
@@ -583,12 +564,6 @@ void perMain()
periodicTick();
DEBUG_TIMER_STOP(debugTimerPerMain1);
if (mainRequestFlags & (1u << REQUEST_FLIGHT_RESET)) {
TRACE("Executing requested Flight Reset");
flightReset();
mainRequestFlags &= ~(1u << REQUEST_FLIGHT_RESET);
}
checkBacklight();
#if defined(USE_HATS_AS_KEYS)
@@ -646,6 +621,11 @@ void perMain()
bindButtonHandler(evt);
#endif
if (radioGFEnabled())
evalUIFunctions(g_eeGeneral.customFn, globalFunctionsContext);
if (modelSFEnabled())
evalUIFunctions(g_model.customFn, modelFunctionsContext);
#if defined(GUI)
DEBUG_TIMER_START(debugTimerGuiMain);
#if defined(COLORLCD)
-19
View File
@@ -1228,25 +1228,6 @@ void evalMixes(uint8_t tick10ms)
}
}
#endif
#if defined(AUDIO)
if (!isFunctionActive(FUNCTION_VOLUME)) {
if (g_eeGeneral.volumeSrc) {
calcVolumeValue(g_eeGeneral.volumeSrc);
} else {
requiredSpeakerVolume =
limit<int>(0, g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF, VOLUME_LEVEL_MAX);
}
}
#endif
if (!isFunctionActive(FUNCTION_BACKLIGHT)) {
if (g_eeGeneral.backlightSrc) {
calcBacklightValue(g_eeGeneral.backlightSrc);
} else {
requiredBacklightBright = g_eeGeneral.getBrightness();
}
}
}
//========== LIMITS ===============
+1 -1
View File
@@ -106,4 +106,4 @@ add_custom_target(yaml_data
${RADIO_DIRECTORY}/util/generate_yaml.py
)
add_dependencies(yaml_data hal_settings)
add_dependencies(yaml_data hal_settings hal_keys_lock)
@@ -85,6 +85,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -86,6 +86,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -87,6 +87,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_LCD_TO_VIDEO, "LCD_TO_VIDEO" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -86,6 +86,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -86,6 +86,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -93,6 +93,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -87,6 +87,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -93,6 +93,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -86,6 +86,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -87,6 +87,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -87,6 +87,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -87,6 +87,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -86,6 +86,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -87,6 +87,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -86,6 +86,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -87,6 +87,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -87,6 +87,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_PUSH_CUST_SWITCH, "PUSH_CUST_SWITCH" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -86,6 +86,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -85,6 +85,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -85,6 +85,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -85,6 +85,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -85,6 +85,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
@@ -85,6 +85,7 @@ const struct YamlIdStr enum_Functions[] = {
{ FUNC_SET_SCREEN, "SET_SCREEN" },
{ FUNC_DISABLE_AUDIO_AMP, "DISABLE_AUDIO_AMP" },
{ FUNC_RGB_LED, "RGB_LED" },
{ FUNC_DISABLE_KEYS, "DISABLE_KEYS" },
{ FUNC_TEST, "TEST" },
{ 0, NULL }
};
+26 -24
View File
@@ -38,36 +38,38 @@ TEST_F(SpecialFunctionsTest, SwitchFiledSize)
TEST_F(SpecialFunctionsTest, FlightReset)
{
int sw;
for (sw = 0; sw < switchGetMaxAllSwitches(); sw += 1)
if (g_model.getSwitchType(sw) == SWITCH_3POS)
break;
int swPos = (sw * 3) + SWSRC_FIRST_SWITCH;
// Moved from mixer to UI task
g_model.customFn[0].swtch = swPos;
g_model.customFn[0].func = FUNC_RESET;
g_model.customFn[0].all.val = FUNC_RESET_FLIGHT;
g_model.customFn[0].active = true;
// int sw;
// for (sw = 0; sw < switchGetMaxAllSwitches(); sw += 1)
// if (g_model.getSwitchType(sw) == SWITCH_3POS)
// break;
// int swPos = (sw * 3) + SWSRC_FIRST_SWITCH;
mainRequestFlags = 0;
simuSetSwitch(sw, 0);
EXPECT_FALSE(getSwitch(swPos));
// g_model.customFn[0].swtch = swPos;
// g_model.customFn[0].func = FUNC_RESET;
// g_model.customFn[0].all.val = FUNC_RESET_FLIGHT;
// g_model.customFn[0].active = true;
evalFunctions(g_model.customFn, modelFunctionsContext);
EXPECT_FALSE((bool)(mainRequestFlags & (1 << REQUEST_FLIGHT_RESET)));
// mainRequestFlags = 0;
// simuSetSwitch(sw, 0);
// EXPECT_FALSE(getSwitch(swPos));
// now trigger SA0
simuSetSwitch(sw, -1);
EXPECT_TRUE(getSwitch(swPos));
// evalFunctions(g_model.customFn, modelFunctionsContext);
// EXPECT_FALSE((bool)(mainRequestFlags & (1 << REQUEST_FLIGHT_RESET)));
// flightReset() should be called
evalFunctions(g_model.customFn, modelFunctionsContext);
EXPECT_TRUE((bool)(mainRequestFlags & (1 << REQUEST_FLIGHT_RESET)));
// // now trigger SA0
// simuSetSwitch(sw, -1);
// EXPECT_TRUE(getSwitch(swPos));
// now reset mainRequestFlags, and it should stay reset (flightReset() should not be called again)
mainRequestFlags = 0;
evalFunctions(g_model.customFn, modelFunctionsContext);
EXPECT_FALSE((bool)(mainRequestFlags & (1 << REQUEST_FLIGHT_RESET)));
// // flightReset() should be called
// evalFunctions(g_model.customFn, modelFunctionsContext);
// EXPECT_TRUE((bool)(mainRequestFlags & (1 << REQUEST_FLIGHT_RESET)));
// // now reset mainRequestFlags, and it should stay reset (flightReset() should not be called again)
// mainRequestFlags = 0;
// evalFunctions(g_model.customFn, modelFunctionsContext);
// EXPECT_FALSE((bool)(mainRequestFlags & (1 << REQUEST_FLIGHT_RESET)));
}
#if defined(GVARS)
+4 -1
View File
@@ -240,6 +240,7 @@
#define TR_SF_SCREENSHOT "截屏"
#define TR_SF_RACING_MODE "竞速模式"
#define TR_SF_DISABLE_TOUCH "禁用触摸"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "关闭音频功放"
#define TR_SF_SET_SCREEN TR_BW_COL("设置主屏", "选择主屏")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -563,8 +564,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "开机图片"
#define TR_PLAY_HELLO "开机语音"
#define TR_PWR_ON_DELAY "开机延迟"
+4 -1
View File
@@ -242,6 +242,7 @@
#define TR_SF_SCREENSHOT "Snímek LCD"
#define TR_SF_RACING_MODE "Závodní režim"
#define TR_SF_DISABLE_TOUCH "Deaktivace dotyku"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Vypnutí zesilovače zvuku"
#define TR_SF_SET_SCREEN TR_BW_COL("Nast obrazovku", "Vybrat hlavní obrazovku")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -565,8 +566,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN TR("úvodní logo", "Zobrazit úvodní logo")
#define TR_PLAY_HELLO "Zvuk při spuštění"
#define TR_PWR_ON_DELAY "Zpoždění zapnutí"
+4 -1
View File
@@ -242,6 +242,7 @@
#define TR_SF_SCREENSHOT "Skærm klip"
#define TR_SF_RACING_MODE "Ræs tilstand"
#define TR_SF_DISABLE_TOUCH "Ikke berøringsaktiv"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP TR("Sluk audio amp", "Sluk audio amplifier")
#define TR_SF_SET_SCREEN TR_BW_COL("Vis skærm", "Vælg hoved skærm")
#define TR_SF_PUSH_CUST_SWITCH TR("Tryk BK", "Tryk bruger kontakt")
@@ -568,8 +569,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Start skærm"
#define TR_PLAY_HELLO "Startop lyd"
#define TR_PWR_ON_DELAY "Forsinkelse ved tænd"
+4 -1
View File
@@ -243,6 +243,7 @@
#define TR_SF_SCREENSHOT "Screenshot"
#define TR_SF_RACING_MODE "RacingMode"
#define TR_SF_DISABLE_TOUCH "Kein Touch"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Audio Verst. Aus"
#define TR_SF_SET_SCREEN TR_BW_COL("Seite anz.", "Hauptseite anzeigen")
#define TR_SF_PUSH_CUST_SWITCH "LS setzen"
@@ -565,8 +566,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN TR("Startbild Ein", "Startbild Anzeigedauer")
#define TR_PLAY_HELLO "Startton abspielen"
#define TR_PWR_ON_DELAY TR("PWR EIN Verzög.", "Einschaltverzögerung")
+4 -1
View File
@@ -241,6 +241,7 @@
#define TR_SF_SCREENSHOT "Screenshot"
#define TR_SF_RACING_MODE "RacingMode"
#define TR_SF_DISABLE_TOUCH "No Touch"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
#define TR_SF_SET_SCREEN TR_BW_COL("Set Screen", "Set Main Screen")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -564,8 +565,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Splash screen"
#define TR_PLAY_HELLO "Startup Sound"
#define TR_PWR_ON_DELAY "Pwr On delay"
+4 -1
View File
@@ -240,6 +240,7 @@
#define TR_SF_SCREENSHOT "Captura"
#define TR_SF_RACING_MODE "RacingMode"
#define TR_SF_DISABLE_TOUCH "No Touch"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
#define TR_SF_SET_SCREEN TR_BW_COL("Ajus. pantalla", "Set Main Screen")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -562,8 +563,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Pantalla inicio"
#define TR_PLAY_HELLO "Startup Sound"
#define TR_PWR_ON_DELAY TR("Atraso On", "Atraso encendido")
+4 -1
View File
@@ -241,6 +241,7 @@
#define TR_SF_SCREENSHOT "Screenshot"
#define TR_SF_RACING_MODE "RacingMode"
#define TR_SF_DISABLE_TOUCH "No Touch"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
#define TR_SF_SET_SCREEN TR_BW_COL("Set Screen", "Set Main Screen")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -563,8 +564,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Splash screen"
#define TR_PLAY_HELLO "Startup Sound"
#define TR_PWR_ON_DELAY "Pwr On delay"
+4 -1
View File
@@ -244,6 +244,7 @@
#define TR_SF_SCREENSHOT "Photo Écran"
#define TR_SF_RACING_MODE "Racing Mode"
#define TR_SF_DISABLE_TOUCH "Non Tactile"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Désact. Ampli Audio"
#define TR_SF_SET_SCREEN TR_BW_COL("Aff. écran", "Définir Écran Princ.")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -566,8 +567,10 @@
#define TR_ONE_LOG_PER_DAY "Un log par jour"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Écran d'accueil"
#define TR_PLAY_HELLO "Son de démarrage"
#define TR_PWR_ON_DELAY "Délai btn ON"
+4 -1
View File
@@ -244,6 +244,7 @@
#define TR_SF_SCREENSHOT "צילום מסך"
#define TR_SF_RACING_MODE "מצב תחרות"
#define TR_SF_DISABLE_TOUCH "ללא מסך מגע"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
#define TR_SF_SET_SCREEN TR_BW_COL("Set Screen", "הגדרת מסך ראשי")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -567,8 +568,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "מסך פתיחה"
#define TR_PLAY_HELLO "צליל אתחול"
#define TR_PWR_ON_DELAY "השהיית הפעלה פעיל"
+4 -1
View File
@@ -241,6 +241,7 @@
#define TR_SF_SCREENSHOT "Screenshot"
#define TR_SF_RACING_MODE "Modo Racing"
#define TR_SF_DISABLE_TOUCH "Disab. touch"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Amp Audio Off"
#define TR_SF_SET_SCREEN TR_BW_COL("Setta Schermo", "Setta Schermo Princ.")
#define TR_SF_PUSH_CUST_SWITCH "Premi CS"
@@ -564,8 +565,10 @@
#define TR_ONE_LOG_PER_DAY "Un log al giorno"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN TR("Sch. avvio", "Schermata d'avvio")
#define TR_PLAY_HELLO "Suono all'accensione"
#define TR_PWR_ON_DELAY "Rit. accens."
+4 -1
View File
@@ -241,6 +241,7 @@
#define TR_SF_SCREENSHOT "画面キャプチャ"
#define TR_SF_RACING_MODE "レースモード"
#define TR_SF_DISABLE_TOUCH "非タッチ"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "オーディオアンプ OFF"
#define TR_SF_SET_SCREEN TR_BW_COL("画面設定", "メイン画面設定")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -563,8 +564,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "起動イメージ"
#define TR_PLAY_HELLO "起動時サウンド"
#define TR_PWR_ON_DELAY "電源ON遅延"
+4 -1
View File
@@ -241,6 +241,7 @@
#define TR_SF_SCREENSHOT "스크린샷 저장"
#define TR_SF_RACING_MODE "레이싱 모드"
#define TR_SF_DISABLE_TOUCH "터치 비활성화"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "오디오 앰프 끄기"
#define TR_SF_SET_SCREEN TR_BW_COL("텔레 화면 설정", "메인 화면 설정")
#define TR_SF_PUSH_CUST_SWITCH "커스텀 스위치 실행"
@@ -573,8 +574,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "시작화면"
#define TR_PLAY_HELLO "시작 사운드"
+4 -1
View File
@@ -241,6 +241,7 @@
#define TR_SF_SCREENSHOT "Schermafdr"
#define TR_SF_RACING_MODE "RacingMode"
#define TR_SF_DISABLE_TOUCH "No Touch"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Audio Amp Off"
#define TR_SF_SET_SCREEN TR_BW_COL("Set Screen", "Set Main Screen")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -565,8 +566,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Startscherm Aan"
#define TR_PLAY_HELLO "Startup Sound"
#define TR_PWR_ON_DELAY "Pwr On delay"
+4 -1
View File
@@ -240,6 +240,7 @@
#define TR_SF_SCREENSHOT "Zrzut Ekra"
#define TR_SF_RACING_MODE "RacingMode"
#define TR_SF_DISABLE_TOUCH "No Touch"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP TR("Wycisz wzm.", "Wycisz wzmacniacz audio")
#define TR_SF_SET_SCREEN TR_BW_COL("Ustaw ekran", "Set Main Screen")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -563,8 +564,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Logo ekranu"
#define TR_PLAY_HELLO "Dźwięk uruchomienia"
#define TR_PWR_ON_DELAY "Pwr On delay"
+4 -1
View File
@@ -241,6 +241,7 @@
#define TR_SF_SCREENSHOT "Capt. Tela"
#define TR_SF_RACING_MODE "ModCorrida"
#define TR_SF_DISABLE_TOUCH "No Touch"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Amp Audio Desl"
#define TR_SF_SET_SCREEN TR_BW_COL("Def Tela", "Def Tela Princ")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -563,8 +564,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Tela abertura"
#define TR_PLAY_HELLO "Som ao ligar"
#define TR_PWR_ON_DELAY "Delay para LIGA"
+4 -1
View File
@@ -244,6 +244,7 @@
#define TR_SF_SCREENSHOT "Скриншот"
#define TR_SF_RACING_MODE "Режим гонка"
#define TR_SF_DISABLE_TOUCH "Сенсор вык"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Вык аудио усил."
#define TR_SF_SET_SCREEN TR_BW_COL("Устан экран", "Выбр глав экран")
#define TR_SF_PUSH_CUST_SWITCH "Нажать CS"
@@ -566,8 +567,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Заставка"
#define TR_PLAY_HELLO "Звук запуска"
#define TR_PWR_ON_DELAY "Время включ"
+4 -1
View File
@@ -244,6 +244,7 @@
#define TR_SF_SCREENSHOT "Skärmbild"
#define TR_SF_RACING_MODE "Tävlingsläge"
#define TR_SF_DISABLE_TOUCH "Ej pekskärm"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP TR("Audioförst. av","Audioförstärkare av")
#define TR_SF_SET_SCREEN TR_BW_COL("Visa skärm", "Sätt huvudskärm")
#define TR_SF_PUSH_CUST_SWITCH "Tryck CS"
@@ -566,8 +567,10 @@
#define TR_ONE_LOG_PER_DAY "En logg per dag"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Startbild"
#define TR_PLAY_HELLO "Startljud"
#define TR_PWR_ON_DELAY "Fördröj start"
+4 -1
View File
@@ -239,6 +239,7 @@
#define TR_SF_SCREENSHOT "截屏"
#define TR_SF_RACING_MODE "競速模式"
#define TR_SF_DISABLE_TOUCH "禁用觸摸"
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "關閉音頻功放"
#define TR_SF_SET_SCREEN TR_BW_COL("設置主屏", "選擇主屏")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -561,8 +562,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "開機圖片"
#define TR_PLAY_HELLO "開機語音"
#define TR_PWR_ON_DELAY "開機延遲"
+4 -1
View File
@@ -243,6 +243,7 @@
#define TR_SF_SCREENSHOT "Скріншот"
#define TR_SF_RACING_MODE "Режим перегонів"
#define TR_SF_DISABLE_TOUCH "Сенсор вимк."
#define TR_SF_DISABLE_KEYS "No Keys"
#define TR_SF_DISABLE_AUDIO_AMP "Підсил. вимк."
#define TR_SF_SET_SCREEN TR_BW_COL("Set Screen", "Вибір гол. екр.")
#define TR_SF_PUSH_CUST_SWITCH "Push CS"
@@ -565,8 +566,10 @@
#define TR_ONE_LOG_PER_DAY "One log per day"
#define TR_KEY_LOCK_FMT "Key lock (%s+%s hold)"
#define TR_KEYS_LOCKED "Keys locked"
#define TR_KEYS_LOCKED_FMT "Keys locked (%s+%s)"
#define TR_KEYS_LOCKED_FMT TR_BW_COL("%s+%s to unlock", "Keys locked (%s+%s to unlock)")
#define TR_KEYS_UNLOCKED "Keys unlocked"
#define TR_TOUCH_ENABLED "Touch screen enabled"
#define TR_TOUCH_DISABLED "Touch screen disabled"
#define TR_SPLASHSCREEN "Заставка"
#define TR_PLAY_HELLO "Звук запуску"
#define TR_PWR_ON_DELAY "Затримка увімкн."
+8
View File
@@ -887,6 +887,7 @@
#define STR_SF_BG_MUSIC currentLangStrings->STR_SF_BG_MUSIC
#define STR_SF_DISABLE_AUDIO_AMP currentLangStrings->STR_SF_DISABLE_AUDIO_AMP
#define STR_SF_DISABLE_TOUCH currentLangStrings->STR_SF_DISABLE_TOUCH
#define STR_SF_DISABLE_KEYS currentLangStrings->STR_SF_DISABLE_KEYS
#define STR_SF_FAILSAFE currentLangStrings->STR_SF_FAILSAFE
#define STR_SF_HAPTIC currentLangStrings->STR_SF_HAPTIC
#define STR_SF_INST_TRIM currentLangStrings->STR_SF_INST_TRIM
@@ -924,6 +925,13 @@
#define STR_SPECTRUM_ANALYSER_EXT currentLangStrings->STR_SPECTRUM_ANALYSER_EXT
#define STR_SPECTRUM_ANALYSER_INT currentLangStrings->STR_SPECTRUM_ANALYSER_INT
#define STR_SPLASHSCREEN currentLangStrings->STR_SPLASHSCREEN
#define STR_ONE_LOG_PER_DAY currentLangStrings->STR_ONE_LOG_PER_DAY
#define STR_KEY_LOCK_FMT currentLangStrings->STR_KEY_LOCK_FMT
#define STR_KEYS_LOCKED currentLangStrings->STR_KEYS_LOCKED
#define STR_KEYS_LOCKED_FMT currentLangStrings->STR_KEYS_LOCKED_FMT
#define STR_KEYS_UNLOCKED currentLangStrings->STR_KEYS_UNLOCKED
#define STR_TOUCH_ENABLED currentLangStrings->STR_TOUCH_ENABLED
#define STR_TOUCH_DISABLED currentLangStrings->STR_TOUCH_DISABLED
#define STR_SPORT_UPDATE_POWER_MODE currentLangStrings->STR_SPORT_UPDATE_POWER_MODE
#define STR_SRC_BATT currentLangStrings->STR_SRC_BATT
#define STR_SRC_GPS currentLangStrings->STR_SRC_GPS
+3
View File
@@ -883,6 +883,7 @@ STR(SF_BG_MUSIC_PAUSE)
STR(SF_BG_MUSIC)
STR(SF_DISABLE_AUDIO_AMP)
STR(SF_DISABLE_TOUCH)
STR(SF_DISABLE_KEYS)
STR(SF_FAILSAFE)
STR(SF_HAPTIC)
STR(SF_INST_TRIM)
@@ -978,6 +979,8 @@ STR(TMIXMAXMS)
STR(TOO_MANY_LUA_SCRIPTS)
STR(TOP_BAR)
STR(TOPLCDTIMER)
STR(TOUCH_DISABLED)
STR(TOUCH_ENABLED)
STR(TOUCH_PANEL)
STR(TRAINER_SHUTDOWN_ALARM)
STR(TRAINER_STILL_CONNECTED)
+1
View File
@@ -128,6 +128,7 @@ int main()
{ TR_SF_RGBLEDS, "FUNC_RGB_LED", FUNC_RGB_LED, "" },
{ TR_SF_LCD_TO_VIDEO, "FUNC_LCD_TO_VIDEO", FUNC_LCD_TO_VIDEO, "defined(VIDEO_SWITCH)" },
{ TR_SF_PUSH_CUST_SWITCH, "FUNC_PUSH_CUST_SWITCH", FUNC_PUSH_CUST_SWITCH, "defined(FUNCTION_SWITCHES)" },
{ TR_SF_DISABLE_KEYS, "FUNC_DISABLE_KEYS", FUNC_DISABLE_KEYS, "defined(KEYS_LOCK_KEY1) && defined(KEYS_LOCK_KEY2)" },
{ TR_SF_TEST, "FUNC_TEST", FUNC_TEST, "defined(DEBUG)" },
};
+1
View File
@@ -88,6 +88,7 @@ cat <<EOF >> "${OUTPUT_FILE}"
// This file is auto-generated via cfn_sorter.sh. Do not edit.
#include "dataconstants.h"
#include "hal_keys_lock.h"
Functions cfn_sorted[] = {
EOF