]> git.earman.xyz Git - sensor-watch.git/commitdiff
don't destroy our temperature log when waking from sleep
authorJoey Castillo <jose.castillo@gmail.com>
Mon, 25 Oct 2021 22:32:59 +0000 (18:32 -0400)
committerJoey Castillo <jose.castillo@gmail.com>
Mon, 25 Oct 2021 22:32:59 +0000 (18:32 -0400)
movement/watch_faces/thermistor/thermistor_logging_face.c

index 5351ce8820cce76166202c99372918ce917cd253..3e9e62b31476a3670522976d562060777d5777f3 100644 (file)
@@ -50,8 +50,10 @@ void _thermistor_logging_face_update_display(thermistor_logger_state_t *logger_s
 
 void thermistor_logging_face_setup(movement_settings_t *settings, void ** context_ptr) {
     (void) settings;
-    if (*context_ptr == NULL) *context_ptr = malloc(sizeof(thermistor_logger_state_t));
-    memset(*context_ptr, 0, sizeof(thermistor_logger_state_t));
+    if (*context_ptr == NULL) {
+        *context_ptr = malloc(sizeof(thermistor_logger_state_t));
+        memset(*context_ptr, 0, sizeof(thermistor_logger_state_t));
+    }
 }
 
 void thermistor_logging_face_activate(movement_settings_t *settings, void *context) {