Fixes a bug for case: telemetry values used in logical switches and they have a duration and/or delay set.

This commit is contained in:
Damjan Adamic
2014-07-03 20:50:31 +02:00
parent 1fef79ce80
commit d675ab1578
+4 -2
View File
@@ -241,8 +241,10 @@ bool getLogicalSwitch(uint8_t idx)
#if defined(FRSKY)
// Telemetry
if (v1 >= MIXSRC_FIRST_TELEM) {
if ((!TELEMETRY_STREAMING() && v1 >= MIXSRC_FIRST_TELEM+TELEM_FIRST_STREAMED_VALUE-1) || IS_FAI_FORBIDDEN(v1-1))
return false;
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)
}
y = convertLswTelemValue(ls);