Re #1443 - Reverting back d675ab1578 with some improvements:

* when telemetry is not streaming all logical switches that involve telemetry value evaluate to FALSE (same as before the change in above commit)
* the duration and delay processing is now enabled for such logical switches (new functionality that was not present before above commit)
This commit is contained in:
Damjan Adamic
2014-07-07 19:18:18 +02:00
parent ee077a06e6
commit b4e816b784
2 changed files with 101 additions and 17 deletions
+6 -2
View File
@@ -242,8 +242,8 @@ bool getLogicalSwitch(uint8_t idx)
// Telemetry
if (v1 >= MIXSRC_FIRST_TELEM) {
if ((!TELEMETRY_STREAMING() && v1 >= MIXSRC_FIRST_TELEM+TELEM_FIRST_STREAMED_VALUE-1) || IS_FAI_FORBIDDEN(v1-1)) {
x = 0; //replace actual value with zero and continue processing (needed for duraton and delay)
//we could also return actual stored values (except when FAI FORBIDDEN, then we would return 0)
result = false;
goto DurationAndDelayProcessing;
}
y = convertLswTelemValue(ls);
@@ -334,6 +334,10 @@ bool getLogicalSwitch(uint8_t idx)
}
}
#if defined(FRSKY)
DurationAndDelayProcessing:
#endif
#if defined(CPUARM)
if (ls->delay || ls->duration) {
LogicalSwitchContext &context = lswFm[mixerCurrentFlightMode].lsw[idx];