diff options
author | taemin.yeom <taemin.yeom@samsung.com> | 2021-08-23 10:57:09 +0900 |
---|---|---|
committer | taemin.yeom <taemin.yeom@samsung.com> | 2021-08-23 10:57:09 +0900 |
commit | 509c28424e854a2d59b156da6f76ea43aaf6c8b8 (patch) | |
tree | 8319e3c2ecf95a57b2753a8a0980d5bc4a12489f | |
parent | 0005024ab8780afeed8c76673b28068f53358a4f (diff) | |
download | sensor-rpi-509c28424e854a2d59b156da6f76ea43aaf6c8b8.tar.gz sensor-rpi-509c28424e854a2d59b156da6f76ea43aaf6c8b8.tar.bz2 sensor-rpi-509c28424e854a2d59b156da6f76ea43aaf6c8b8.zip |
Fix axis direction of sensorstizen_6.5.m2_releasesubmit/tizen_6.5/20211028.163201submit/tizen/20210916.054029submit/tizen/20210831.021755accepted/tizen/unified/20210917.124835accepted/tizen/6.5/unified/20211028.115547
Change-Id: I773223931314cbbdf3fec4a27b0ec6b1ce14cb8a
Signed-off-by: taemin.yeom <taemin.yeom@samsung.com>
-rw-r--r-- | src/accelerometer/accel_device.cpp | 6 | ||||
-rw-r--r-- | src/gyroscope/gyro_device.cpp | 6 | ||||
-rw-r--r-- | src/magnetometer/magnet_device.cpp | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/accelerometer/accel_device.cpp b/src/accelerometer/accel_device.cpp index 0c5145c..f812906 100644 --- a/src/accelerometer/accel_device.cpp +++ b/src/accelerometer/accel_device.cpp @@ -211,11 +211,11 @@ bool accel_device::update_value_i2c(void) peripheral_i2c_read_register_word(m_i2c_handle, OUT_Y_L_XL, (uint16_t*) &temp[1]); peripheral_i2c_read_register_word(m_i2c_handle, OUT_Z_L_XL, (uint16_t*) &temp[2]); - if ((temp[0] == m_x) && (temp[1] == m_y) && (temp[2] == m_z)) + if ((temp[0] == m_y) && (temp[1] == m_x) && (temp[2] == m_z)) return false; - m_x = temp[0]; - m_y = temp[1]; + m_x = temp[1]; + m_y = temp[0]; m_z = temp[2]; m_fired_time = util::get_timestamp(); diff --git a/src/gyroscope/gyro_device.cpp b/src/gyroscope/gyro_device.cpp index 6715398..a3a58d1 100644 --- a/src/gyroscope/gyro_device.cpp +++ b/src/gyroscope/gyro_device.cpp @@ -205,11 +205,11 @@ bool gyro_device::update_value_i2c(void) peripheral_i2c_read_register_word(m_i2c_handle, OUT_Y_L_G, (uint16_t*) &temp[1]); peripheral_i2c_read_register_word(m_i2c_handle, OUT_Z_L_G, (uint16_t*) &temp[2]); - if ((temp[0] == m_x) && (temp[1] == m_y) && (temp[2] == m_z)) + if ((temp[0] == m_y) && (temp[1] == m_x) && (temp[2] == m_z)) return false; - m_x = temp[0]; - m_y = temp[1]; + m_x = temp[1]; + m_y = temp[0]; m_z = temp[2]; m_fired_time = util::get_timestamp(); diff --git a/src/magnetometer/magnet_device.cpp b/src/magnetometer/magnet_device.cpp index 8ce97f6..af92d1f 100644 --- a/src/magnetometer/magnet_device.cpp +++ b/src/magnetometer/magnet_device.cpp @@ -244,11 +244,11 @@ bool magnet_device::update_value_i2c(void) peripheral_i2c_read_register_word(m_i2c_handle, OUT_Y_L_M, (uint16_t*) &temp[1]); peripheral_i2c_read_register_word(m_i2c_handle, OUT_Z_L_M, (uint16_t*) &temp[2]); - if ((temp[0] == m_x) && (temp[1] == m_y) && (temp[2] == m_z)) + if ((temp[0] == -m_y) && (temp[1] == m_x) && (temp[2] == m_z)) return false; - m_x = temp[0]; - m_y = temp[1]; + m_x = temp[1]; + m_y = -temp[0]; m_z = temp[2]; m_fired_time = util::get_timestamp(); |