SleepTk: Adapt for mainline accel_xyz() impl

This commit is contained in:
Peter Cai 2022-06-14 22:42:50 -04:00
parent 978b647cea
commit e7f53f1d25

View file

@ -500,13 +500,13 @@ class SleepTkApp():
_STORE_FREQ seconds"""
if self._currently_tracking:
buff = self._buff
xyz = wasp.watch.accel.read_xyz()
xyz = wasp.watch.accel.accel_xyz()
if xyz == (0, 0, 0):
wasp.watch.accel.reset()
xyz = wasp.watch.accel.read_xyz()
buff[0] += xyz[0]
buff[1] += xyz[1]
buff[2] += xyz[2]
xyz = wasp.watch.accel.accel_xyz()
buff[0] += xyz[1]
buff[1] += xyz[0]
buff[2] -= xyz[2]
self._data_point_nb += 1
# add alarm to log accel data in _FREQ seconds