diff options
-rw-r--r-- | aries/libsensors/BoschYamaha.cpp | 11 | ||||
-rw-r--r-- | aries/libsensors/BoschYamaha.h | 3 |
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;
|