Skip to content

Commit b231415

Browse files
simensrostadcarlescufi
authored andcommitted
ADXL362: Do not clear last bits of 16-bit inactivity time value
The inactivity time registers identified by `ADXL362_REG_TIME_INACT_L` and `ADXL362_REG_TIME_INACT_H` accepts a 16-bit value. (8 in each). Without this change the last 5 bits of the register value will be cleared. Clearing the last bits of the register value greatly reduces the maximum inactivity time that can be set. Signed-off-by: Simen S. Røstad <[email protected]>
1 parent 6755999 commit b231415

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/sensor/adxl362/adxl362.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static int adxl362_attr_set(const struct device *dev,
324324
{
325325
uint16_t timeout = val->val1;
326326

327-
return adxl362_set_reg(dev, (timeout & 0x7FF), ADXL362_REG_TIME_INACT_L, 2);
327+
return adxl362_set_reg(dev, timeout, ADXL362_REG_TIME_INACT_L, 2);
328328
}
329329
default:
330330
/* Do nothing */

0 commit comments

Comments
 (0)