From 2afc30f5f354c162906d8097445344e5ea648636 Mon Sep 17 00:00:00 2001 From: Viorel Suman Date: Tue, 16 Jun 2015 17:36:30 +0300 Subject: [PATCH] hrtimer sampling frequency must be integral number hrtimer sampling frequency must be an integral number, so round to smallest integral value not less than the passed frequency. Change-Id: I0e7ca644dee3f679b1e26f422e3d87eedf7c7482 Signed-off-by: Viorel Suman --- control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control.c b/control.c index 2fd5b0d..bb67530 100644 --- a/control.c +++ b/control.c @@ -889,7 +889,7 @@ static int sensor_set_rate (int s, float requested_rate) ALOGI("Sensor %d (%s) sampling rate set to %g\n", s, sensor[s].friendly_name, arb_sampling_rate); if (sensor[s].hrtimer_trigger_name[0] != '\0') - sysfs_write_float(hrtimer_sampling_path, arb_sampling_rate); + sysfs_write_float(hrtimer_sampling_path, ceilf(arb_sampling_rate)); if (trig_sensors_per_dev[dev_num]) enable_buffer(dev_num, 0); -- 2.11.0