diff options
author | tilaksidduram <tilaksidduram@gmail.com> | 2016-03-28 13:55:09 +0530 |
---|---|---|
committer | tilaksidduram <tilaksidduram@gmail.com> | 2016-04-02 11:18:22 +0530 |
commit | 1c76a1b3a2d18c95a441e86f771e27494905dabc (patch) | |
tree | 17096da503cea52799bdd4f9f4359174a74c7cf9 /libsensors/GyroSensor.cpp | |
parent | 0a4d368084f62673639d0f53f35b9f8623c53753 (diff) | |
download | device_samsung_n7100-1c76a1b3a2d18c95a441e86f771e27494905dabc.zip device_samsung_n7100-1c76a1b3a2d18c95a441e86f771e27494905dabc.tar.gz device_samsung_n7100-1c76a1b3a2d18c95a441e86f771e27494905dabc.tar.bz2 |
n7100: update sensors
* trying to fix compass.
Diffstat (limited to 'libsensors/GyroSensor.cpp')
-rw-r--r-- | libsensors/GyroSensor.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libsensors/GyroSensor.cpp b/libsensors/GyroSensor.cpp index 7d3a2d9..770afbd 100644 --- a/libsensors/GyroSensor.cpp +++ b/libsensors/GyroSensor.cpp @@ -80,16 +80,19 @@ int GyroSensor::setInitialState() { int GyroSensor::enable(int32_t handle, int en) { int flags = en ? 1 : 0; - int err; + int fd; if (flags != mEnabled) { - if(err >= 0){ - mEnabled = flags; - err = sspEnable(LOGTAG, SSP_GYRO, en); - setInitialState(); - - return 0; - } - return -1; + strcpy(&input_sysfs_path[input_sysfs_path_len], "enable"); + fd = open(input_sysfs_path, O_RDWR); + if (fd >= 0){ + write(fd, en == 1 ? "1" : "0", 2); + close(fd); + mEnabled = flags; + setInitialState(); + + return 0; + } + return -1; } return 0; } |