rename thermistor_readout_face -> temperature_display_face
This commit is contained in:
parent
77034fbe05
commit
918c410c9a
@ -32,7 +32,7 @@ const watch_face_t watch_faces[] = {
|
||||
world_clock_face,
|
||||
sunrise_sunset_face,
|
||||
moon_phase_face,
|
||||
thermistor_readout_face,
|
||||
temperature_display_face,
|
||||
|
||||
preferences_face,
|
||||
set_time_face,
|
||||
|
||||
@ -31,7 +31,7 @@ const watch_face_t watch_faces[] = {
|
||||
simple_clock_face,
|
||||
sunrise_sunset_face,
|
||||
moon_phase_face,
|
||||
thermistor_readout_face,
|
||||
temperature_display_face,
|
||||
thermistor_logging_face,
|
||||
blinky_face,
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include "set_time_face.h"
|
||||
#include "set_time_hackwatch_face.h"
|
||||
#include "pulsometer_face.h"
|
||||
#include "thermistor_readout_face.h"
|
||||
#include "temperature_display_face.h"
|
||||
#include "thermistor_logging_face.h"
|
||||
#include "thermistor_testing_face.h"
|
||||
#include "character_set_face.h"
|
||||
|
||||
@ -24,11 +24,11 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "thermistor_readout_face.h"
|
||||
#include "temperature_display_face.h"
|
||||
#include "thermistor_driver.h"
|
||||
#include "watch.h"
|
||||
|
||||
static void _thermistor_readout_face_update_display(bool in_fahrenheit) {
|
||||
static void _temperature_display_face_update_display(bool in_fahrenheit) {
|
||||
thermistor_driver_enable();
|
||||
float temperature_c = thermistor_driver_get_temperature();
|
||||
char buf[14];
|
||||
@ -41,23 +41,23 @@ static void _thermistor_readout_face_update_display(bool in_fahrenheit) {
|
||||
thermistor_driver_disable();
|
||||
}
|
||||
|
||||
void thermistor_readout_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
void temperature_display_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
(void) context_ptr;
|
||||
}
|
||||
|
||||
void thermistor_readout_face_activate(void *context) {
|
||||
void temperature_display_face_activate(void *context) {
|
||||
(void) context;
|
||||
watch_display_string("TE", 0);
|
||||
}
|
||||
|
||||
bool thermistor_readout_face_loop(movement_event_t event, void *context) {
|
||||
bool temperature_display_face_loop(movement_event_t event, void *context) {
|
||||
(void) context;
|
||||
watch_date_time_t date_time = watch_rtc_get_date_time();
|
||||
switch (event.event_type) {
|
||||
case EVENT_ALARM_BUTTON_DOWN:
|
||||
movement_set_use_imperial_units(!movement_use_imperial_units());
|
||||
_thermistor_readout_face_update_display(movement_use_imperial_units());
|
||||
_temperature_display_face_update_display(movement_use_imperial_units());
|
||||
break;
|
||||
case EVENT_ACTIVATE:
|
||||
// force a measurement to be taken immediately.
|
||||
@ -70,7 +70,7 @@ bool thermistor_readout_face_loop(movement_event_t event, void *context) {
|
||||
// In reality the measurement takes a fraction of a second, but this is just to show something is happening.
|
||||
watch_set_indicator(WATCH_INDICATOR_SIGNAL);
|
||||
} else if (date_time.unit.second % 5 == 0) {
|
||||
_thermistor_readout_face_update_display(movement_use_imperial_units());
|
||||
_temperature_display_face_update_display(movement_use_imperial_units());
|
||||
watch_clear_indicator(WATCH_INDICATOR_SIGNAL);
|
||||
}
|
||||
break;
|
||||
@ -83,7 +83,7 @@ bool thermistor_readout_face_loop(movement_event_t event, void *context) {
|
||||
// update every 5 minutes
|
||||
if (date_time.unit.minute % 5 == 0) {
|
||||
watch_clear_indicator(WATCH_INDICATOR_SIGNAL);
|
||||
_thermistor_readout_face_update_display(movement_use_imperial_units());
|
||||
_temperature_display_face_update_display(movement_use_imperial_units());
|
||||
watch_display_string(" ", 8);
|
||||
}
|
||||
break;
|
||||
@ -95,6 +95,6 @@ bool thermistor_readout_face_loop(movement_event_t event, void *context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void thermistor_readout_face_resign(void *context) {
|
||||
void temperature_display_face_resign(void *context) {
|
||||
(void) context;
|
||||
}
|
||||
@ -22,8 +22,8 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef THERMISTOR_READOUT_FACE_H_
|
||||
#define THERMISTOR_READOUT_FACE_H_
|
||||
#ifndef TEMPERATURE_DISPLAY_FACE_H_
|
||||
#define TEMPERATURE_DISPLAY_FACE_H_
|
||||
|
||||
/*
|
||||
* THERMISTOR READOUT (aka Temperature Display)
|
||||
@ -50,17 +50,17 @@
|
||||
|
||||
#include "movement.h"
|
||||
|
||||
void thermistor_readout_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void thermistor_readout_face_activate(void *context);
|
||||
bool thermistor_readout_face_loop(movement_event_t event, void *context);
|
||||
void thermistor_readout_face_resign(void *context);
|
||||
void temperature_display_face_setup(uint8_t watch_face_index, void ** context_ptr);
|
||||
void temperature_display_face_activate(void *context);
|
||||
bool temperature_display_face_loop(movement_event_t event, void *context);
|
||||
void temperature_display_face_resign(void *context);
|
||||
|
||||
#define thermistor_readout_face ((const watch_face_t){ \
|
||||
thermistor_readout_face_setup, \
|
||||
thermistor_readout_face_activate, \
|
||||
thermistor_readout_face_loop, \
|
||||
thermistor_readout_face_resign, \
|
||||
#define temperature_display_face ((const watch_face_t){ \
|
||||
temperature_display_face_setup, \
|
||||
temperature_display_face_activate, \
|
||||
temperature_display_face_loop, \
|
||||
temperature_display_face_resign, \
|
||||
NULL, \
|
||||
})
|
||||
|
||||
#endif // THERMISTOR_READOUT_FACE_H_
|
||||
#endif // TEMPERATURE_DISPLAY_FACE_H_
|
||||
@ -31,7 +31,7 @@
|
||||
* This watch face is designed for testing temperature sensor boards.
|
||||
* It displays temperature readings at a relatively fast rate of 8 Hz,
|
||||
* and disables low energy mode so my testing device doesn't sleep.
|
||||
* You more than likely want to use thermistor_readout_face instead.
|
||||
* You more than likely want to use temperature_display_face instead.
|
||||
*
|
||||
* Press ALARM to toggle display of metric vs. imperial units.
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user