]> git.earman.xyz Git - sensor-watch.git/commitdiff
Renamed LIS2DW_FIFO_TIMEOUT_SECOND to LIS2DW_FIFO_TIMEOUT
authorDavid Volovskiy <devolov@gmail.com>
Thu, 13 Nov 2025 13:19:22 +0000 (08:19 -0500)
committerAlessandro Genova <ales.genova@gmail.com>
Sat, 3 Jan 2026 01:07:56 +0000 (20:07 -0500)
legacy/watch_faces/sensor/accelerometer_data_acquisition_face.c
watch-faces/sensor/lis2dw_monitor_face.c
watch-library/shared/driver/lis2dw.h

index 968a7b81b45215ea14b605747055446326cd4fd9..cb49e01882d952f720e634cf8f8ed413f7fc3e5f 100644 (file)
@@ -448,13 +448,13 @@ static void start_reading(accelerometer_data_acquisition_state_t *state) {
 
     state->records[state->pos++] = record;
     lis2dw_fifo_t fifo;
-    lis2dw_read_fifo(&fifo, LIS2DW_FIFO_TIMEOUT_SECOND); // dump the fifo, this starts a fresh round of data in continue_reading
+    lis2dw_read_fifo(&fifo, LIS2DW_FIFO_TIMEOUT); // dump the fifo, this starts a fresh round of data in continue_reading
 }
 
 static void continue_reading(accelerometer_data_acquisition_state_t *state) {
     printf("Continue reading\n");
     lis2dw_fifo_t fifo;
-    lis2dw_read_fifo(&fifo, LIS2DW_FIFO_TIMEOUT_SECOND);
+    lis2dw_read_fifo(&fifo, LIS2DW_FIFO_TIMEOUT);
 
     fifo.count = min(fifo.count, 25); // hacky, but we need a consistent data rate; if we got a 26th data point, chuck it.
     uint8_t offset = 4 * (25 - fifo.count); // also hacky: we're sometimes short at the start. align to beginning of next second.
index ade0df550f47d2e38651d875c676b9ea904ffa81..8afb7d3e3440cad94b23f24a9df41585c5a86a4d 100644 (file)
@@ -420,7 +420,7 @@ static void _monitor_update(lis2dw_monitor_state_t *state)
     lis2dw_fifo_t fifo;
     float x = 0, y = 0, z = 0;
 
-    lis2dw_read_fifo(&fifo, LIS2DW_FIFO_TIMEOUT_SECOND / DISPLAY_FREQUENCY);
+    lis2dw_read_fifo(&fifo, LIS2DW_FIFO_TIMEOUT / DISPLAY_FREQUENCY);
     if (fifo.count == 0) {
         return;
     }
index f81c7750edbed3fe707b7b2c2044e6146e570496..fc5947e0991869b4eddf6c50120a3d36508bf903 100644 (file)
@@ -301,7 +301,7 @@ typedef enum {
 #define LIS2DW_CTRL7_VAL_HP_REF_MODE        0b00000010
 #define LIS2DW_CTRL7_VAL_LPASS_ON6D         0b00000001
 
-#define LIS2DW_FIFO_TIMEOUT_SECOND          100
+#define LIS2DW_FIFO_TIMEOUT                 100  // timeout is in terms of 1/RTC_CNT_HZ seconds (likely 128 timeouts is one second)
 
 bool lis2dw_begin(void);