Add airspeed sensor to sensor_simulator

This commit is contained in:
kamilritz
2020-01-09 15:46:34 +01:00
committed by Roman Bapst
parent 4044abdd20
commit 7ed6a437c7
23 changed files with 177 additions and 33 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ Sensor::~Sensor()
{
}
void Sensor::update(uint32_t time)
void Sensor::update(uint64_t time)
{
if(should_send(time))
{
@@ -20,12 +20,12 @@ void Sensor::update(uint32_t time)
}
}
bool Sensor::should_send(uint32_t time) const
bool Sensor::should_send(uint64_t time) const
{
return _is_running && is_time_to_send(time);
}
bool Sensor::is_time_to_send(uint32_t time) const
bool Sensor::is_time_to_send(uint64_t time) const
{
return (time >= _time_last_data_sent) && ((time - _time_last_data_sent) >= _update_period);
}