CHROMIUM: iio: cros_ec: Fix gyro scale calculation
Calculation was copied from IIO_DEGREE_TO_RAD, but offset added to avoid
rounding error is wrong. It should be only half of the divider.
BUG=none
TEST=Check scale is closer from float calculation.
For instance, with 1000dps, the result should be:
(1000 * pi ) / 180 >> 15 ~= 0.000532632218
Before
cat scale : 0.000547890
After
cat scale : 0.000532631
Change-Id: I36eae7d7943ff70e19b37bc1ae1acef2fd39649c
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1221768
Reviewed-by: Enrico Granata <egranata@chromium.org>
(cherry picked from commit 6faf2e30c1fd36d7a30227ff7dd58594455e7d36)
Reviewed-on: https://chromium-review.googlesource.com/1227448
1 file changed