Compilation fix
This commit is contained in:
@@ -209,8 +209,9 @@ static void luaPushLatLon(lua_State* L, TelemetrySensor & telemetrySensor, Telem
|
||||
lua_pushtablenumber(L, "lon", telemetryItem.gps.longitude * 0.000001);
|
||||
lua_pushtablenumber(L, "pilot-lon", telemetryItem.pilotLongitude * 0.000001);
|
||||
|
||||
if (telemetryItem.hasReceiveTime())
|
||||
lua_pushtableinteger(L, "delay", telemetryItem.getDelaySinceLastValue());
|
||||
int8_t delay = telemetryItem.getDelaySinceLastValue();
|
||||
if (delay >= 0)
|
||||
lua_pushtableinteger(L, "delay", delay);
|
||||
else
|
||||
lua_pushtablenil(L, "delay");
|
||||
}
|
||||
|
||||
@@ -103,6 +103,16 @@ class TelemetryItem
|
||||
return (timeout == TELEMETRY_SENSOR_TIMEOUT_OLD);
|
||||
}
|
||||
|
||||
inline bool hasReceiveTime()
|
||||
{
|
||||
return timeout >= 0;
|
||||
}
|
||||
|
||||
inline int8_t getDelaySinceLastValue()
|
||||
{
|
||||
return hasReceiveTime() ? TELEMETRY_SENSOR_TIMEOUT_START - timeout : TELEMETRY_SENSOR_TIMEOUT_OLD;
|
||||
}
|
||||
|
||||
inline bool isFresh()
|
||||
{
|
||||
return TELEMETRY_SENSOR_TIMEOUT_START - timeout <= 1; // 2 * 160ms
|
||||
|
||||
Reference in New Issue
Block a user