rename thermistor_logging_face -> temperature_logging_face
This commit is contained in:
parent
918c410c9a
commit
1e633f87b0
@ -32,7 +32,7 @@ const watch_face_t watch_faces[] = {
|
||||
sunrise_sunset_face,
|
||||
moon_phase_face,
|
||||
temperature_display_face,
|
||||
thermistor_logging_face,
|
||||
temperature_logging_face,
|
||||
blinky_face,
|
||||
|
||||
preferences_face,
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include "set_time_hackwatch_face.h"
|
||||
#include "pulsometer_face.h"
|
||||
#include "temperature_display_face.h"
|
||||
#include "thermistor_logging_face.h"
|
||||
#include "temperature_logging_face.h"
|
||||
#include "thermistor_testing_face.h"
|
||||
#include "character_set_face.h"
|
||||
#include "beats_face.h"
|
||||
|
||||
@ -24,11 +24,11 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "thermistor_logging_face.h"
|
||||
#include "temperature_logging_face.h"
|
||||
#include "thermistor_driver.h"
|
||||
#include "watch.h"
|
||||
|
||||
static void _thermistor_logging_face_log_data(thermistor_logger_state_t *logger_state) {
|
||||
static void _temperature_logging_face_log_data(thermistor_logger_state_t *logger_state) {
|
||||
thermistor_driver_enable();
|
||||
watch_date_time_t date_time = watch_rtc_get_date_time();
|
||||
size_t pos = logger_state->data_points % THERMISTOR_LOGGING_NUM_DATA_POINTS;
|
||||
@ -40,7 +40,7 @@ static void _thermistor_logging_face_log_data(thermistor_logger_state_t *logger_
|
||||
thermistor_driver_disable();
|
||||
}
|
||||
|
||||
static void _thermistor_logging_face_update_display(thermistor_logger_state_t *logger_state, bool in_fahrenheit, bool clock_mode_24h) {
|
||||
static void _temperature_logging_face_update_display(thermistor_logger_state_t *logger_state, bool in_fahrenheit, bool clock_mode_24h) {
|
||||
int8_t pos = (logger_state->data_points - 1 - logger_state->display_index) % THERMISTOR_LOGGING_NUM_DATA_POINTS;
|
||||
char buf[14];
|
||||
|
||||
@ -72,7 +72,7 @@ static void _thermistor_logging_face_update_display(thermistor_logger_state_t *l
|
||||
watch_display_string(buf, 0);
|
||||
}
|
||||
|
||||
void thermistor_logging_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
void temperature_logging_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
if (*context_ptr == NULL) {
|
||||
*context_ptr = malloc(sizeof(thermistor_logger_state_t));
|
||||
@ -80,13 +80,13 @@ void thermistor_logging_face_setup(uint8_t watch_face_index, void ** context_ptr
|
||||
}
|
||||
}
|
||||
|
||||
void thermistor_logging_face_activate(void *context) {
|
||||
void temperature_logging_face_activate(void *context) {
|
||||
thermistor_logger_state_t *logger_state = (thermistor_logger_state_t *)context;
|
||||
logger_state->display_index = 0;
|
||||
logger_state->ts_ticks = 0;
|
||||
}
|
||||
|
||||
bool thermistor_logging_face_loop(movement_event_t event, void *context) {
|
||||
bool temperature_logging_face_loop(movement_event_t event, void *context) {
|
||||
thermistor_logger_state_t *logger_state = (thermistor_logger_state_t *)context;
|
||||
switch (event.event_type) {
|
||||
case EVENT_TIMEOUT:
|
||||
@ -98,22 +98,22 @@ bool thermistor_logging_face_loop(movement_event_t event, void *context) {
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
logger_state->ts_ticks = 2;
|
||||
_thermistor_logging_face_update_display(logger_state, movement_use_imperial_units(), movement_clock_mode_24h());
|
||||
_temperature_logging_face_update_display(logger_state, movement_use_imperial_units(), movement_clock_mode_24h());
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
logger_state->display_index = (logger_state->display_index + 1) % THERMISTOR_LOGGING_NUM_DATA_POINTS;
|
||||
logger_state->ts_ticks = 0;
|
||||
// fall through
|
||||
case EVENT_ACTIVATE:
|
||||
_thermistor_logging_face_update_display(logger_state, movement_use_imperial_units(), movement_clock_mode_24h());
|
||||
_temperature_logging_face_update_display(logger_state, movement_use_imperial_units(), movement_clock_mode_24h());
|
||||
break;
|
||||
case EVENT_TICK:
|
||||
if (logger_state->ts_ticks && --logger_state->ts_ticks == 0) {
|
||||
_thermistor_logging_face_update_display(logger_state, movement_use_imperial_units(), movement_clock_mode_24h());
|
||||
_temperature_logging_face_update_display(logger_state, movement_use_imperial_units(), movement_clock_mode_24h());
|
||||
}
|
||||
break;
|
||||
case EVENT_BACKGROUND_TASK:
|
||||
_thermistor_logging_face_log_data(logger_state);
|
||||
_temperature_logging_face_log_data(logger_state);
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event);
|
||||
@ -123,11 +123,11 @@ bool thermistor_logging_face_loop(movement_event_t event, void *context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void thermistor_logging_face_resign(void *context) {
|
||||
void temperature_logging_face_resign(void *context) {
|
||||
(void) context;
|
||||
}
|
||||
|
||||
movement_watch_face_advisory_t thermistor_logging_face_advise(void *context) {
|
||||
movement_watch_face_advisory_t temperature_logging_face_advise(void *context) {
|
||||
(void) context;
|
||||
movement_watch_face_advisory_t retval = { 0 };
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef THERMISTOR_LOGGING_FACE_H_
|
||||
#define THERMISTOR_LOGGING_FACE_H_
|
||||
#ifndef TEMPERATURE_LOGGING_FACE_H_
|
||||
#define TEMPERATURE_LOGGING_FACE_H_
|
||||
|
||||
/*
|
||||
* THERMISTOR LOGGING (aka Temperature Log)
|
||||
@ -70,18 +70,18 @@ typedef struct {
|
||||
thermistor_logger_data_point_t data[THERMISTOR_LOGGING_NUM_DATA_POINTS];
|
||||
} thermistor_logger_state_t;
|
||||
|
||||
void thermistor_logging_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void thermistor_logging_face_activate(void *context);
|
||||
bool thermistor_logging_face_loop(movement_event_t event, void *context);
|
||||
void thermistor_logging_face_resign(void *context);
|
||||
movement_watch_face_advisory_t thermistor_logging_face_advise(void *context);
|
||||
void temperature_logging_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void temperature_logging_face_activate(void *context);
|
||||
bool temperature_logging_face_loop(movement_event_t event, void *context);
|
||||
void temperature_logging_face_resign(void *context);
|
||||
movement_watch_face_advisory_t temperature_logging_face_advise(void *context);
|
||||
|
||||
#define thermistor_logging_face ((const watch_face_t){ \
|
||||
thermistor_logging_face_setup, \
|
||||
thermistor_logging_face_activate, \
|
||||
thermistor_logging_face_loop, \
|
||||
thermistor_logging_face_resign, \
|
||||
thermistor_logging_face_advise, \
|
||||
#define temperature_logging_face ((const watch_face_t){ \
|
||||
temperature_logging_face_setup, \
|
||||
temperature_logging_face_activate, \
|
||||
temperature_logging_face_loop, \
|
||||
temperature_logging_face_resign, \
|
||||
temperature_logging_face_advise, \
|
||||
})
|
||||
|
||||
#endif // THERMISTOR_LOGGING_FACE_H_
|
||||
#endif // TEMPERATURE_LOGGING_FACE_H_
|
||||
Loading…
x
Reference in New Issue
Block a user