]> git.earman.xyz Git - sensor-watch.git/commitdiff
faces/pulsometer: move structure definition
authorMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Sat, 24 Feb 2024 08:17:56 +0000 (05:17 -0300)
committerMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Sat, 24 Feb 2024 08:17:56 +0000 (05:17 -0300)
Instances of the pulsometer state structure are only passed
to the pulsometer itself and only via the opaque context pointer.
No other code uses it. There is no need to expose it in a header file
so make it an implementation detail of the watch face.

movement/watch_faces/complication/pulsometer_face.c
movement/watch_faces/complication/pulsometer_face.h

index 5e0209ba7c96d1c9f07607fbdffe356b40410138..8c5f1cd6557976bbb62637f91b44bfb76d4ff226 100644 (file)
 
 #define PULSOMETER_FACE_FREQUENCY (1 << PULSOMETER_FACE_FREQUENCY_FACTOR)
 
+typedef struct {
+    bool measuring;
+    int16_t pulses;
+    int16_t ticks;
+    int8_t calibration;
+} pulsometer_state_t;
+
 static void pulsometer_display_title(pulsometer_state_t *pulsometer) {
     watch_display_string(PULSOMETER_FACE_TITLE, 0);
 }
index ba629f2ae5361ab289073ada943d332a3d83e262..5c1dae911a05d54438b0f2354942a349fe206b7b 100644 (file)
 
 #include "movement.h"
 
-typedef struct {
-    bool measuring;
-    int16_t pulses;
-    int16_t ticks;
-    int8_t calibration;
-} pulsometer_state_t;
-
 void pulsometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
 void pulsometer_face_activate(movement_settings_t *settings, void *context);
 bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context);