summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguiperpt@gmail.com <guiperpt@gmail.com>2011-03-05 18:08:04 +0000
committerguiperpt@gmail.com <guiperpt@gmail.com>2011-03-05 18:08:04 +0000
commitced8fc80ea8c208ded34badc002f049a603dd386 (patch)
tree78afd701e0831ecc0276dffbc3edf55dd4dd6b67
parente8f88a17d64a94980422c8e19fc9d190a2a92c70 (diff)
downloaddevice_samsung_aries-common-ced8fc80ea8c208ded34badc002f049a603dd386.zip
device_samsung_aries-common-ced8fc80ea8c208ded34badc002f049a603dd386.tar.gz
device_samsung_aries-common-ced8fc80ea8c208ded34badc002f049a603dd386.tar.bz2
Fixed Accelerometer errors after Google Navigation and so programs which use compass.
Compass is disabled since it does not work perfectly. We need GB kernel sources. Change-Id: I51ab01e370b0c3c7c0392b64a93220cf52bfd63c
-rw-r--r--aries/libsensors/BoschYamaha.cpp11
-rw-r--r--aries/libsensors/BoschYamaha.h3
2 files changed, 12 insertions, 2 deletions
diff --git a/aries/libsensors/BoschYamaha.cpp b/aries/libsensors/BoschYamaha.cpp
index e7049a3..ba88ff9 100644
--- a/aries/libsensors/BoschYamaha.cpp
+++ b/aries/libsensors/BoschYamaha.cpp
@@ -49,9 +49,12 @@ BoschYamaha::BoschYamaha()
mInputReaderAccel(4)
{
+ counterAccel = 0;
+
/* FIXME set input device name for magnetic sensor */
data_name = "input0";
data_compass_fd = openInput("geomagnetic");
+
//Open Compass
if (data_compass_fd) {
@@ -131,6 +134,7 @@ int BoschYamaha::enable(int32_t handle, int en)
int newState = en ? 1 : 0;
int err = 0;
+ /*
//FIXME enabling the right sensor over sysfs interface
if(what == MagneticField){
what = Accelerometer; //Enable also Accel
@@ -160,6 +164,7 @@ int BoschYamaha::enable(int32_t handle, int en)
}
}
}
+ */
if(what == Accelerometer){
//Accelerometer
@@ -176,11 +181,15 @@ int BoschYamaha::enable(int32_t handle, int en)
int err;
buf[1] = 0;
if (flags) {
+ // counterAccel++;
buf[0] = '1';
} else {
+ // counterAccel--;
buf[0] = '0';
}
- err = write(fd, buf, sizeof(buf));
+ //if(counterAccel <= 1){
+ err = write(fd, buf, sizeof(buf));
+ //}
close(fd);
//mEnabled = flags;
accelEnabled = flags;
diff --git a/aries/libsensors/BoschYamaha.h b/aries/libsensors/BoschYamaha.h
index 728e0eb..52af86b 100644
--- a/aries/libsensors/BoschYamaha.h
+++ b/aries/libsensors/BoschYamaha.h
@@ -64,7 +64,8 @@ private:
float accelLastRead[3];
float compassLastRead[3];
int compassDataReady;
- int accelDataReady;
+ int accelDataReady;
+ int counterAccel;
uint32_t mPendingMask;
InputEventCircularReader mInputReaderMagnetic;
InputEventCircularReader mInputReaderAccel;