mirror of
https://github.com/opentx/opentx.git
synced 2025-07-13 03:19:53 +03:00
Rationalize
This commit is contained in:
parent
0652fa609b
commit
7a0a566238
2 changed files with 8 additions and 10 deletions
|
@ -244,11 +244,14 @@ void telemetryInterrupt10ms()
|
|||
if (sensor.type == TELEM_TYPE_CALCULATED) {
|
||||
telemetryItems[i].per10ms(sensor);
|
||||
}
|
||||
if (tick160ms && telemetryItems[i].timeout > 0) {
|
||||
telemetryItems[i].timeout--;
|
||||
if (tick160ms) {
|
||||
auto & timeout = telemetryItems[i].timeout;
|
||||
if (!MODEL_TELEMETRY_STREAMING() && timeout < TELEMETRY_SENSOR_TIMEOUT_NO_MODEL_TELEM) {
|
||||
timeout = TELEMETRY_SENSOR_TIMEOUT_OLD;
|
||||
}
|
||||
else if (timeout > 0) {
|
||||
timeout--;
|
||||
}
|
||||
if (!MODEL_TELEMETRY_STREAMING() && tick160ms && telemetryItems[i].timeout < TELEMETRY_SENSOR_TIMEOUT_NO_MODEL_TELEM) {
|
||||
telemetryItems[i].timeout = TELEMETRY_SENSOR_TIMEOUT_OLD;
|
||||
}
|
||||
}
|
||||
telemetryStreaming--;
|
||||
|
|
|
@ -40,11 +40,6 @@
|
|||
extern uint8_t telemetryStreaming; // >0 (true) == data is streaming in. 0 = no data detected for some time
|
||||
extern uint8_t modelTelemetryStreaming; // allows to differentiate between module telem and model telem
|
||||
|
||||
inline bool TELEMETRY_STREAMING()
|
||||
{
|
||||
return telemetryStreaming > 0;
|
||||
}
|
||||
|
||||
inline bool MODEL_TELEMETRY_STREAMING()
|
||||
{
|
||||
return modelTelemetryStreaming > 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue