more accelerometer tests: track interrupts on each axis, log on the quarter hour

This commit is contained in:
Joey Castillo
2021-12-05 16:24:17 -06:00
parent bbd394a19a
commit eb66b67e8e
2 changed files with 96 additions and 53 deletions

View File

@@ -4,19 +4,24 @@
#include "movement.h"
#include "watch.h"
#define LIS2DH_LOGGING_NUM_DATA_POINTS (24)
#define LIS2DH_LOGGING_NUM_DATA_POINTS (96)
typedef struct {
watch_date_time timestamp;
uint32_t interrupts;
uint32_t x_interrupts;
uint32_t y_interrupts;
uint32_t z_interrupts;
} lis2dh_logger_data_point_t;
typedef struct {
uint8_t display_index; // the index we are displaying on screen
uint8_t axis_index; // the index we are displaying on screen
uint8_t log_ticks; // when the user taps the ALARM button, we enter log mode
int32_t data_points; // the absolute number of data points logged
uint8_t interrupts[3]; // the number of interrupts we have logged in each of the last 3 minutes
uint32_t interrupts_this_hour; // the number of interrupts we have logged in the last hour
uint32_t x_interrupts_this_hour; // the number of interrupts we have logged in the last hour
uint32_t y_interrupts_this_hour; // the number of interrupts we have logged in the last hour
uint32_t z_interrupts_this_hour; // the number of interrupts we have logged in the last hour
lis2dh_logger_data_point_t data[LIS2DH_LOGGING_NUM_DATA_POINTS];
} lis2dh_logger_state_t;