Merge remote-tracking branch 'origin/next' into
bsongis/Issue524_SPORT_GPS Conflicts: radio/src/telemetry/frsky_sport.cpp radio/src/translations/de.h.txt
This commit is contained in:
@@ -1815,7 +1815,7 @@ enum FlightModesItems {
|
||||
ITEM_PHASES_LAST = ITEM_PHASES_COUNT-1
|
||||
};
|
||||
|
||||
bool isTrimModeAvailable(int16_t mode)
|
||||
bool isTrimModeAvailable(int mode)
|
||||
{
|
||||
return (mode == TRIM_MODE_NONE || (mode%2) == 0 || (mode/2) != (m_posVert-1));
|
||||
}
|
||||
@@ -2186,7 +2186,7 @@ void menuModelHeli(uint8_t event)
|
||||
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||
switch(i) {
|
||||
case ITEM_HELI_SWASHTYPE:
|
||||
g_model.swashR.type = selectMenuItem(HELI_PARAM_OFS, y, STR_SWASHTYPE, STR_VSWASHTYPE, g_model.swashR.type, 0, SWASH_TYPE_NUM, attr, event);
|
||||
g_model.swashR.type = selectMenuItem(HELI_PARAM_OFS, y, STR_SWASHTYPE, STR_VSWASHTYPE, g_model.swashR.type, 0, SWASH_TYPE_MAX, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_HELI_COLLECTIVE:
|
||||
@@ -5754,7 +5754,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
if (attr && (s_editMode>0 || p1valdiff)) {
|
||||
switch (m_posHorz) {
|
||||
case 0:
|
||||
bar.source = checkIncDecModel(event, barSource, 0, TELEM_DISPLAY_MAX);
|
||||
bar.source = CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, barSource, TELEM_DISPLAY_MAX, isTelemetrySourceAvailable);
|
||||
if (checkIncDec_Ret) {
|
||||
bar.barMin = 0;
|
||||
bar.barMax = 255 - maxBarTelemValue(bar.source);
|
||||
@@ -5782,7 +5782,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
#endif
|
||||
lcd_putsiAtt(pos[c], y, STR_VTELEMCHNS, value, cellAttr);
|
||||
if (cellAttr && (s_editMode>0 || p1valdiff)) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, value, (lineIndex==3 && c==0) ? TELEM_STATUS_MAX : TELEM_DISPLAY_MAX);
|
||||
CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, value, (lineIndex==3 && c==0) ? TELEM_STATUS_MAX : TELEM_DISPLAY_MAX, isTelemetrySourceAvailable);
|
||||
}
|
||||
}
|
||||
if (attr && m_posHorz == NUM_LINE_ITEMS) {
|
||||
|
||||
+44
-9
@@ -113,7 +113,7 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui
|
||||
#endif
|
||||
{
|
||||
int16_t newval = val;
|
||||
|
||||
|
||||
#if defined(DBLKEYS)
|
||||
uint8_t in = KEYS_PRESSED();
|
||||
if (EVT_KEY_MASK(event)) {
|
||||
@@ -1333,7 +1333,7 @@ void drawStatusLine()
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
bool isSourceAvailable(int16_t source)
|
||||
bool isSourceAvailable(int source)
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
if (source>=MIXSRC_FIRST_INPUT && source<=MIXSRC_LAST_INPUT) {
|
||||
@@ -1376,10 +1376,35 @@ bool isSourceAvailable(int16_t source)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (source>=MIXSRC_FIRST_TELEM && source<=MIXSRC_LAST_TELEM)
|
||||
return isTelemetrySourceAvailable(source-MIXSRC_FIRST_TELEM+1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isInputSourceAvailable(int16_t source)
|
||||
bool isTelemetrySourceAvailable(int source)
|
||||
{
|
||||
if (source == TELEM_RX_VOLTAGE || source == TELEM_A3 || source == TELEM_A4 || source == TELEM_MIN_A3 || source == TELEM_MIN_A4)
|
||||
return false;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
if (source == TELEM_RSSI_TX)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (source >= TELEM_RESERVE1 && source <= TELEM_RESERVE5)
|
||||
return false;
|
||||
|
||||
if (source >= TELEM_RESERVE6 && source <= TELEM_RESERVE10)
|
||||
return false;
|
||||
|
||||
if (source == TELEM_DTE)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isInputSourceAvailable(int source)
|
||||
{
|
||||
if (source>=MIXSRC_Rud && source<=MIXSRC_MAX)
|
||||
return true;
|
||||
@@ -1390,13 +1415,16 @@ bool isInputSourceAvailable(int16_t source)
|
||||
if (source>=MIXSRC_FIRST_CH && source<=MIXSRC_LAST_CH)
|
||||
return true;
|
||||
|
||||
if (source>=MIXSRC_FIRST_TELEM && source<=MIXSRC_LAST_TELEM)
|
||||
if (source>=MIXSRC_FIRST_PPM && source<=MIXSRC_LAST_PPM)
|
||||
return true;
|
||||
|
||||
if (source>=MIXSRC_FIRST_TELEM && source<=MIXSRC_LAST_TELEM)
|
||||
return isTelemetrySourceAvailable(source-MIXSRC_FIRST_TELEM+1);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isSwitchAvailableInLogicalSwitches(int16_t swtch)
|
||||
bool isSwitchAvailableInLogicalSwitches(int swtch)
|
||||
{
|
||||
if (swtch < 0) {
|
||||
if (swtch <= -SWSRC_ON)
|
||||
@@ -1425,7 +1453,7 @@ bool isSwitchAvailableInLogicalSwitches(int16_t swtch)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isSwitchAvailable(int16_t swtch)
|
||||
bool isSwitchAvailable(int swtch)
|
||||
{
|
||||
if (!isSwitchAvailableInLogicalSwitches(swtch)) {
|
||||
return false;
|
||||
@@ -1439,13 +1467,12 @@ bool isSwitchAvailable(int16_t swtch)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Not available yet, will be needed if we implement the Range function later...
|
||||
bool isLogicalSwitchFunctionAvailable(int16_t function)
|
||||
bool isLogicalSwitchFunctionAvailable(int function)
|
||||
{
|
||||
return function != LS_FUNC_RANGE;
|
||||
}
|
||||
|
||||
bool isAssignableFunctionAvailable(int16_t function)
|
||||
bool isAssignableFunctionAvailable(int function)
|
||||
{
|
||||
switch (function) {
|
||||
|
||||
@@ -1459,6 +1486,14 @@ bool isAssignableFunctionAvailable(int16_t function)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
case FUNC_PLAY_DIFF:
|
||||
case FUNC_RESERVE1:
|
||||
case FUNC_RESERVE2:
|
||||
case FUNC_RESERVE3:
|
||||
case FUNC_RESERVE4:
|
||||
case FUNC_RESERVE5:
|
||||
return false;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
+16
-7
@@ -171,7 +171,7 @@ extern int8_t s_editMode; // global editmode
|
||||
#define HIDDEN_ROW ((uint8_t)-2)
|
||||
|
||||
#if defined(CPUARM)
|
||||
typedef bool (*IsValueAvailable)(int16_t);
|
||||
typedef bool (*IsValueAvailable)(int);
|
||||
int16_t checkIncDec(uint8_t event, int16_t i_pval, int16_t i_min, int16_t i_max, uint8_t i_flags=0, IsValueAvailable isValueAvailable=NULL);
|
||||
#else
|
||||
int16_t checkIncDec(uint8_t event, int16_t i_pval, int16_t i_min, int16_t i_max, uint8_t i_flags=0);
|
||||
@@ -194,10 +194,18 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
|
||||
var = checkIncDecModelZero(event,var,max)
|
||||
|
||||
#if defined(CPUARM)
|
||||
bool isLogicalSwitchFunctionAvailable(int16_t function);
|
||||
bool isAssignableFunctionAvailable(int16_t function);
|
||||
bool isSwitchAvailable(int16_t swtch);
|
||||
bool isSwitchAvailableInLogicalSwitches(int16_t swtch);
|
||||
#define CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, var, max, check) \
|
||||
var = checkIncDec(event, var, 0, max, EE_MODEL, check)
|
||||
#else
|
||||
#define CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, var, max, check) \
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, var, max)
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
bool isLogicalSwitchFunctionAvailable(int function);
|
||||
bool isAssignableFunctionAvailable(int function);
|
||||
bool isSwitchAvailable(int swtch);
|
||||
bool isSwitchAvailableInLogicalSwitches(int swtch);
|
||||
#define AUTOSWITCH_ENTER_LONG() (attr && event==EVT_KEY_LONG(KEY_ENTER))
|
||||
#define CHECK_INCDEC_MODELSWITCH(event, var, min, max) \
|
||||
var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SWITCH|NO_INCDEC_MARKS, isSwitchAvailable)
|
||||
@@ -211,8 +219,9 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
bool isSourceAvailable(int16_t source);
|
||||
bool isInputSourceAvailable(int16_t source);
|
||||
bool isSourceAvailable(int source);
|
||||
bool isTelemetrySourceAvailable(int source);
|
||||
bool isInputSourceAvailable(int source);
|
||||
#define CHECK_INCDEC_MODELSOURCE(event, var, min, max) \
|
||||
var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SOURCE|NO_INCDEC_MARKS, isSourceAvailable)
|
||||
#elif defined(AUTOSOURCE)
|
||||
|
||||
Reference in New Issue
Block a user