OSDN Git Service

IRDA-2056: Fix accuracy indicator for gyroscope readings.
authorPatrick Porlan <patrick.porlan@intel.com>
Wed, 15 Oct 2014 09:32:36 +0000 (11:32 +0200)
committerAdriana Reus <adriana.reus@intel.com>
Tue, 21 Oct 2014 13:27:04 +0000 (16:27 +0300)
Report medium accuracy rather than the default (unreliable) one
if we're not using calibration.

Change-Id: I648075681eed0a82bc081babe8a0825096bbe4a4

gyro-calibration.c
transform.c

index a9aa92c..cfdac9d 100644 (file)
@@ -84,8 +84,6 @@ void calibrate_gyro(struct sensors_event_t* event, struct sensor_info_t* info)
 {
        struct gyro_cal* cal_data = (struct gyro_cal*) info->cal_data;
 
-       event->gyro.status = SENSOR_STATUS_ACCURACY_MEDIUM;
-
        if (cal_data == NULL)
                return;
 
index 1993169..7aebae8 100644 (file)
@@ -286,6 +286,13 @@ static int finalize_sample_default(int s, struct sensors_event_t* data)
 
                case SENSOR_TYPE_GYROSCOPE:
                case SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
+                       /*
+                        * Report medium accuracy by default ; higher accuracy
+                        * levels will be reported once, and if, we achieve
+                        * calibration.
+                        */
+                       data->gyro.status = SENSOR_STATUS_ACCURACY_MEDIUM;
+
                        if (!(sensor_info[s].quirks & QUIRK_TERSE_DRIVER))
                                calibrate_gyro(data, &sensor_info[s]);
                        if (sensor_info[s].quirks & QUIRK_NOISY)