lis2dw driver: fix incorrect register setting
This commit is contained in:
parent
3577e5b5b1
commit
e34925139f
@ -172,10 +172,10 @@ lis2dw_filter_t lis2dw_get_filter_type(void) {
|
||||
}
|
||||
|
||||
void lis2dw_set_low_noise_mode(bool on) {
|
||||
uint8_t val = watch_i2c_read8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL1) & ~(LIS2DW_CTRL6_VAL_LOW_NOISE);
|
||||
uint8_t val = watch_i2c_read8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL6) & ~(LIS2DW_CTRL6_VAL_LOW_NOISE);
|
||||
uint8_t bits = on ? LIS2DW_CTRL6_VAL_LOW_NOISE : 0;
|
||||
|
||||
watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL1, val | bits);
|
||||
watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL6, val | bits);
|
||||
}
|
||||
|
||||
bool lis2dw_get_low_noise_mode(void) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user