summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sensors/ios/iosaccelerometer.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/sensors/ios/iosaccelerometer.mm b/src/plugins/sensors/ios/iosaccelerometer.mm
index 47349c5..a01e418 100644
--- a/src/plugins/sensors/ios/iosaccelerometer.mm
+++ b/src/plugins/sensors/ios/iosaccelerometer.mm
@@ -124,6 +124,10 @@ IOSAccelerometer::~IOSAccelerometer()
void IOSAccelerometer::start()
{
+ // Convert from Hz to NSTimeInterval:
+ int hz = sensor()->dataRate();
+ NSTimeInterval interval = (hz == 0) ? 0 : 1. / hz;
+ [m_listener setInterval:interval];
[m_listener startAccelerometer];
}