summaryrefslogtreecommitdiff
path: root/board/phaser
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-01-18 15:24:12 -0800
committerJustin TerAvest <teravest@chromium.org>2019-01-19 02:05:55 +0000
commitccede6a11f3d4287b0e7a49ca1acc25046c45123 (patch)
tree7ae6533522ab8d6889a2a374b00e944d7d0ca2f8 /board/phaser
parentdc0744d83b7f1118bbb554e1800944d104dfacbd (diff)
downloadchrome-ec-ccede6a11f3d4287b0e7a49ca1acc25046c45123.tar.gz
drvier: lsm6dsm: Populate Gyroscope scale properly
Range of 250/1000/2000 dps is an approximation. The Gyrscope uses a slighly higher range: range | gain(udps/LSB) | actual value(dps) 250 | 8750 | 286.72 500 | 17500 | 573.44 1000 | 35000 | 1146.88 2000 | 70000 | 2293.76 Returns the actual value for a given range. BUG=b:121279721 BRANCH=octopus TEST=Check scale returns the correct value: cd /sys/bus/iio/devices/... for i in 250 500 1000 2000 ; do echo $i > scale ; V=$(cat scale) ; echo -n "$i: " ; echo -n "$V: " ; echo $V | python -c 'import sys for line in sys.stdin: print float(line) * 32768 * 180 / 3.14159' ; done 250: 0.000152331: 285.996835182 500: 0.000305197: 572.998116648 1000: 0.000610395: 1145.99811077 2000: 0.001221325: 2293.00066781 Check CTS Verifier Gyroscope Measurement Test pass. Change-Id: I76c977140321d01702af16f58a3dfb7036673014 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1423597 Reviewed-by: Enrico Granata <egranata@chromium.org>
Diffstat (limited to 'board/phaser')
-rw-r--r--board/phaser/board.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/board/phaser/board.c b/board/phaser/board.c
index ee3c8601cb..1efa2c41cd 100644
--- a/board/phaser/board.c
+++ b/board/phaser/board.c
@@ -179,7 +179,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv_data = &lsm6dsm_g_data,
.port = I2C_PORT_SENSOR,
.addr = LSM6DSM_ADDR0,
- .default_range = 1000, /* dps */
+ .default_range = 1000 | ROUND_UP_FLAG, /* dps */
.rot_standard_ref = &standard_rot_ref,
.min_frequency = LSM6DSM_ODR_MIN_VAL,
.max_frequency = LSM6DSM_ODR_MAX_VAL,