mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 08:15:17 +03:00
Some reserve in telemetry sources added
This commit is contained in:
parent
a47ac42996
commit
7e43a88d3f
6 changed files with 127 additions and 63 deletions
|
@ -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)) {
|
||||
|
@ -1185,7 +1185,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) {
|
||||
|
@ -1228,10 +1228,24 @@ 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_RESERVE1 && source <= TELEM_RESERVE5)
|
||||
return false;
|
||||
|
||||
if (source >= TELEM_RESERVE6 && source <= TELEM_RESERVE10)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isInputSourceAvailable(int source)
|
||||
{
|
||||
if (source>=MIXSRC_Rud && source<=MIXSRC_MAX)
|
||||
return true;
|
||||
|
@ -1243,12 +1257,12 @@ bool isInputSourceAvailable(int16_t source)
|
|||
return true;
|
||||
|
||||
if (source>=MIXSRC_FIRST_TELEM && source<=MIXSRC_LAST_TELEM)
|
||||
return true;
|
||||
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)
|
||||
|
@ -1277,7 +1291,7 @@ bool isSwitchAvailableInLogicalSwitches(int16_t swtch)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool isSwitchAvailable(int16_t swtch)
|
||||
bool isSwitchAvailable(int swtch)
|
||||
{
|
||||
if (!isSwitchAvailableInLogicalSwitches(swtch)) {
|
||||
return false;
|
||||
|
@ -1291,13 +1305,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) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue