mirror of
https://github.com/firewalkwithm3/Sensor-Watch.git
synced 2024-11-23 03:30:30 +08:00
pulsometer: make type more c-like
This commit is contained in:
parent
b4d4f62ba8
commit
8dbbe92a9b
|
@ -8,18 +8,18 @@
|
||||||
|
|
||||||
void pulsometer_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
void pulsometer_face_setup(movement_settings_t *settings, void ** context_ptr) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(PulsometerState));
|
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(pulsometer_state_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void pulsometer_face_activate(movement_settings_t *settings, void *context) {
|
void pulsometer_face_activate(movement_settings_t *settings, void *context) {
|
||||||
(void) settings;
|
(void) settings;
|
||||||
memset(context, 0, sizeof(PulsometerState));
|
memset(context, 0, sizeof(pulsometer_state_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||||
printf("pulsometer_face_loop\n");
|
printf("pulsometer_face_loop\n");
|
||||||
(void) settings;
|
(void) settings;
|
||||||
PulsometerState *pulsometer_state = (PulsometerState *)context;
|
pulsometer_state_t *pulsometer_state = (pulsometer_state_t *)context;
|
||||||
char buf[14];
|
char buf[14];
|
||||||
switch (event.event_type) {
|
switch (event.event_type) {
|
||||||
case EVENT_TICK:
|
case EVENT_TICK:
|
||||||
|
|
|
@ -7,7 +7,7 @@ typedef struct {
|
||||||
bool measuring;
|
bool measuring;
|
||||||
int16_t pulse;
|
int16_t pulse;
|
||||||
int16_t ticks;
|
int16_t ticks;
|
||||||
} PulsometerState;
|
} pulsometer_state_t;
|
||||||
|
|
||||||
void pulsometer_face_setup(movement_settings_t *settings, void ** context_ptr);
|
void pulsometer_face_setup(movement_settings_t *settings, void ** context_ptr);
|
||||||
void pulsometer_face_activate(movement_settings_t *settings, void *context);
|
void pulsometer_face_activate(movement_settings_t *settings, void *context);
|
||||||
|
|
Loading…
Reference in a new issue