OSDN Git Service

GMIN-2992: Prefix uncalibrated gyro name with Uncalibrated
authorPatrick Porlan <patrick.porlan@intel.com>
Thu, 28 Aug 2014 17:20:01 +0000 (19:20 +0200)
committerAdriana Reus <adriana.reus@intel.com>
Mon, 8 Sep 2014 07:46:37 +0000 (10:46 +0300)
Otherwise it's not clear in many applications which of the two
gyroscopes is the uncalibrated one.

Issue: GMIN-2992

Change-Id: I5610e16290e0e8914efb8bf5aa3a8250bc141509
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
enumeration.c

index 6e29f64..e334508 100644 (file)
@@ -659,6 +659,7 @@ static void uncalibrated_gyro_check (void)
        unsigned int dev_num;
        int i, c;
        unsigned int is_poll_sensor;
+       char buf[MAX_NAME_SIZE];
 
        int cal_idx = 0;
        int uncal_idx = 0;
@@ -705,6 +706,12 @@ static void uncalibrated_gyro_check (void)
                                strncpy(sensor_info[uncal_idx].motion_trigger_name,
                                        sensor_info[cal_idx].motion_trigger_name,
                                        MAX_NAME_SIZE);
+
+                               /* Add "Uncalibrated " prefix to sensor name */
+                               strcpy(buf, sensor_info[cal_idx].friendly_name);
+                               snprintf(sensor_info[uncal_idx].friendly_name,
+                                        MAX_NAME_SIZE,
+                                        "%s %s", "Uncalibrated", buf);
                                break;
                        }
 }