]> git.earman.xyz Git - sensor-watch.git/commitdiff
lis2dw driver: fix incorrect register setting
authorjoeycastillo <joeycastillo@utexas.edu>
Sat, 19 Oct 2024 18:53:52 +0000 (14:53 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Sat, 19 Oct 2024 18:53:52 +0000 (14:53 -0400)
watch-library/shared/driver/lis2dw.c

index 8376d8ce4ba719fb9faedd24957266a20a5604c2..a9d21706b931097e5021615f26d045a50b60dcaa 100644 (file)
@@ -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) {