Skip to content

Commit 89bde52

Browse files
committed
sensors: MS_ABSOLUTE_IMU: fix negative values
Forgot to change data types from unsigned to signed in ada9c0e
1 parent ada9c0e commit 89bde52

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sensors/nxt_i2c_sensor_defs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static void ms_8ch_servo_remove_cb(struct nxt_i2c_sensor_data *data)
155155
* the value is 90 degrees, when the axis is pointing down, the value is -90
156156
* degrees, when the arrow is horizontal, the value is 0 degrees.
157157
*/
158-
static const u8 ms_imu_tilt2deg[] = {
158+
static const s8 ms_imu_tilt2deg[] = {
159159
90, 83, 80, 78, 76, 74, 72, 71, 70, 68, 67, 66, 65, 64, 63, 62, 61, 60,
160160
59, 58, 57, 57, 56, 55, 54, 54, 53, 52, 51, 51, 50, 49, 49, 48, 47, 47,
161161
46, 45, 45, 44, 43, 43, 42, 42, 41, 40, 40, 39, 39, 38, 37, 37, 36, 36,
@@ -1762,7 +1762,7 @@ const struct nxt_i2c_sensor_info nxt_i2c_sensor_defs[] = {
17621762
.name = "TILT",
17631763
.scale = ms_imu_scale,
17641764
.data_sets = 3,
1765-
.data_type = LEGO_SENSOR_DATA_U8,
1765+
.data_type = LEGO_SENSOR_DATA_S8,
17661766
.units = "deg",
17671767
},
17681768
[1] = {

0 commit comments

Comments
 (0)