diff options
author | Joey Castillo <joeycastillo@utexas.edu> | 2021-12-01 18:57:03 -0500 |
---|---|---|
committer | Joey Castillo <joeycastillo@utexas.edu> | 2021-12-01 18:57:03 -0500 |
commit | 8723c70033b8b62151a7fd25a7671ff2359b9d88 (patch) | |
tree | 01338ef7ae2b97a800b98c17f12f0055f2da98ed /movement/watch_faces | |
parent | 0679d84c037f5a9c0c4abb056599f806a59aae3b (diff) | |
download | Sensor-Watch-8723c70033b8b62151a7fd25a7671ff2359b9d88.tar.gz Sensor-Watch-8723c70033b8b62151a7fd25a7671ff2359b9d88.tar.bz2 Sensor-Watch-8723c70033b8b62151a7fd25a7671ff2359b9d88.zip |
movement: fix off-by-one error in accelerometer test face
Diffstat (limited to 'movement/watch_faces')
-rw-r--r-- | movement/watch_faces/demos/lis2dh_logging_face.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/movement/watch_faces/demos/lis2dh_logging_face.c b/movement/watch_faces/demos/lis2dh_logging_face.c index 367564da..0e4383cd 100644 --- a/movement/watch_faces/demos/lis2dh_logging_face.c +++ b/movement/watch_faces/demos/lis2dh_logging_face.c @@ -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; |