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