joeycastillo / Sensor-Watch

A board replacement for the classic Casio F-91W wristwatch
Other
1.02k stars 210 forks source link

did a tiny bit of code cleanup, encountered a bug that might fix some sleep-mode issues #339

Closed theAlexes closed 5 months ago

theAlexes commented 6 months ago

while renaming the current_watch_face and next_watch_face to be clear that they are indexes into the watch_face array, we updated the app loop to use a pointer to the current face. This made us realize that the face loop can be visited twice in one turn, and thus cause conflict in can_sleep. This is resolved by boolean-ANDing the previous result in.

WesleyAC commented 5 months ago

Looks good to me. Slightly dubious about the last commit in the stack but that seems like personal preference as much as anything, so I'm fine with merging it as-is.