Remove unnecessary round trip conversion

This commit is contained in:
Chris Thrasher 2024-05-12 20:59:53 -05:00
parent 08cfbc7d6c
commit 7b4e17be37

View File

@ -99,11 +99,8 @@ bool SensorImpl::open(Sensor::Type sensor)
if (!m_sensor) if (!m_sensor)
return false; return false;
// Get the minimum delay allowed between events
const Time minimumDelay = microseconds(ASensor_getMinDelay(m_sensor));
// Set the event rate (not to consume too much battery) // Set the event rate (not to consume too much battery)
ASensorEventQueue_setEventRate(sensorEventQueue, m_sensor, static_cast<std::int32_t>(minimumDelay.asMicroseconds())); ASensorEventQueue_setEventRate(sensorEventQueue, m_sensor, ASensor_getMinDelay(m_sensor));
// Save the type of the sensor // Save the type of the sensor
m_type = sensor; m_type = sensor;