From: Viorel Suman Date: Tue, 26 May 2015 12:29:10 +0000 (+0300) Subject: Increase the tolerance interval for Sofia StMicro gyro X-Git-Tag: android-x86-7.1-r1~21^2 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fhardware-intel-libsensors.git;a=commitdiff_plain;h=6bfb9a85df3f3ffa0170325f3c4c11d8f1a8e75f Increase the tolerance interval for Sofia StMicro gyro For Sofia StMicro gyro "95Hz" frequency option round error goes to "0.0025", so increase the tolerance interval to +-0.01Hz; Change-Id: I9413f9b833027657b07efa34e4f3909a268520d6 Signed-off-by: Viorel Suman --- diff --git a/control.c b/control.c index ebf0e23..dca2eb2 100644 --- a/control.c +++ b/control.c @@ -823,7 +823,7 @@ static int sensor_set_rate (int s, float requested_rate) sr = strtod(cursor, NULL); /* If this matches the selected rate, we're happy. Have some tolerance for rounding errors and avoid needless jumps to higher rates */ - if (fabs(arb_sampling_rate - sr) <= 0.001) { + if (fabs(arb_sampling_rate - sr) <= 0.01) { arb_sampling_rate = sr; break; }