summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Dodd <atd7@cornell.edu>2012-07-10 22:44:59 -0400
committerAndrew Dodd <atd7@cornell.edu>2012-07-10 22:44:59 -0400
commitcbf1cb2a7fd2ac5b80b26626fec0b48c54b82f65 (patch)
tree3444e4e41fe93f9513cbfd91ed22ec269eede7f6
parent827f2f953c875767aae004d08f5659224752d14b (diff)
downloadandroid_hardware_samsung-cbf1cb2a7fd2ac5b80b26626fec0b48c54b82f65.tar.gz
android_hardware_samsung-cbf1cb2a7fd2ac5b80b26626fec0b48c54b82f65.tar.bz2
android_hardware_samsung-cbf1cb2a7fd2ac5b80b26626fec0b48c54b82f65.zip
sensors: Fix conversion values
Our kernel sets the gyro to 500 DPS and not 2000 DPS. In addition, X and Y are swapped and Y is not inverted. Also change the orientation sensor conversion factors to match that found in aries-common since the orientation sensor seemed overly sensitive. However, the orientation sensor might not actually do anything... Android may be performing sensor fusion of other data to determine orientation. Change-Id: I03df5d7bac9d58881e360546af4cf77878802807
-rw-r--r--exynos4/exynos4210/libsensors/sensors.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/exynos4/exynos4210/libsensors/sensors.h b/exynos4/exynos4210/libsensors/sensors.h
index ecc6fed..3c846fe 100644
--- a/exynos4/exynos4210/libsensors/sensors.h
+++ b/exynos4/exynos4210/libsensors/sensors.h
@@ -101,8 +101,8 @@ __BEGIN_DECLS
#define EVENT_TYPE_PROXIMITY ABS_DISTANCE
#define EVENT_TYPE_LIGHT ABS_MISC
-#define EVENT_TYPE_GYRO_X REL_RY
-#define EVENT_TYPE_GYRO_Y REL_RX
+#define EVENT_TYPE_GYRO_X REL_RX
+#define EVENT_TYPE_GYRO_Y REL_RY
#define EVENT_TYPE_GYRO_Z REL_RZ
// 90 LSB = 1G for KR3DM
@@ -123,16 +123,16 @@ __BEGIN_DECLS
#define CONVERT_M_Z (CONVERT_M)
/* conversion of orientation data to degree units */
-#define CONVERT_O (1.0f/64.0f)
+#define CONVERT_O (1.0f/1000.0f)
#define CONVERT_O_A (CONVERT_O)
#define CONVERT_O_P (CONVERT_O)
-#define CONVERT_O_R (-CONVERT_O)
+#define CONVERT_O_R (CONVERT_O)
// conversion of gyro data to SI units (radian/sec)
-#define RANGE_GYRO (2000.0f*(float)M_PI/180.0f)
-#define CONVERT_GYRO ((70.0f / 1000.0f) * ((float)M_PI / 180.0f))
+#define RANGE_GYRO (500.0f*(float)M_PI/180.0f)
+#define CONVERT_GYRO ((70.0f / 4000.0f) * ((float)M_PI / 180.0f))
#define CONVERT_GYRO_X (CONVERT_GYRO)
-#define CONVERT_GYRO_Y (-CONVERT_GYRO)
+#define CONVERT_GYRO_Y (CONVERT_GYRO)
#define CONVERT_GYRO_Z (CONVERT_GYRO)
#define SENSOR_STATE_MASK (0x7FFF)