]> git.earman.xyz Git - sensor-watch.git/commitdiff
movement: convert can_sleep an automatic variable
authorMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Wed, 6 Mar 2024 00:08:10 +0000 (21:08 -0300)
committerMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Wed, 6 Mar 2024 00:08:10 +0000 (21:08 -0300)
It is a simple boolean value and its scope is limited to the function.
There is no reason that I can think of for it to be a static variable.

movement/movement.c

index d780a2f3781f43ea9712605ffe31c103a8a48839..c64df0c0731939ba8096c36727080e73270029a5 100644 (file)
@@ -509,7 +509,7 @@ bool app_loop(void) {
     }
 
     // default to being allowed to sleep by the face.
-    static bool can_sleep = true;
+    bool can_sleep = true;
 
     if (event.event_type) {
         event.subsecond = movement_state.subsecond;