OSDN Git Service

Increase the tolerance interval for Sofia StMicro gyro
authorViorel Suman <viorel.suman@intel.com>
Tue, 26 May 2015 12:29:10 +0000 (15:29 +0300)
committerGerrit Code Review <gerrit2@irsgerrit001.ir.intel.com>
Tue, 26 May 2015 12:38:05 +0000 (13:38 +0100)
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 <viorel.suman@intel.com>
control.c

index ebf0e23..dca2eb2 100644 (file)
--- 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;
                        }