movement: fix off-by-one error in accelerometer test face

This commit is contained in:
Joey Castillo 2021-12-01 18:57:03 -05:00
parent 0679d84c03
commit 8723c70033

View File

@ -14,6 +14,7 @@
void _lis2dh_logging_face_log_data(lis2dh_logger_state_t *logger_state) {
watch_date_time date_time = watch_rtc_get_date_time();
date_time.unit.hour = (date_time.unit.hour + 23) % 24; // log this as the number of events in the previous hour
size_t pos = logger_state->data_points % LIS2DH_LOGGING_NUM_DATA_POINTS;
logger_state->data[pos].timestamp.reg = date_time.reg;
logger_state->data[pos].interrupts = logger_state->interrupts_this_hour;