let temperature screen skip itself, restore it to the default firmware
This commit is contained in:
parent
40a0308059
commit
63dbaad730
@ -35,6 +35,7 @@ const watch_face_t watch_faces[] = {
|
|||||||
countdown_face,
|
countdown_face,
|
||||||
stopwatch_face,
|
stopwatch_face,
|
||||||
voltage_face,
|
voltage_face,
|
||||||
|
temperature_display_face,
|
||||||
settings_face,
|
settings_face,
|
||||||
set_time_face
|
set_time_face
|
||||||
};
|
};
|
||||||
@ -47,7 +48,7 @@ const watch_face_t watch_faces[] = {
|
|||||||
* Some folks also like to use this to hide the preferences and time set faces from the normal rotation.
|
* Some folks also like to use this to hide the preferences and time set faces from the normal rotation.
|
||||||
* If you don't want any faces to be excluded, set this to 0 and a long Mode press will have no effect.
|
* If you don't want any faces to be excluded, set this to 0 and a long Mode press will have no effect.
|
||||||
*/
|
*/
|
||||||
#define MOVEMENT_SECONDARY_FACE_INDEX (MOVEMENT_NUM_FACES - 3)
|
#define MOVEMENT_SECONDARY_FACE_INDEX (MOVEMENT_NUM_FACES - 4)
|
||||||
|
|
||||||
/* Custom hourly chime tune. Check movement_custom_signal_tunes.h for options. */
|
/* Custom hourly chime tune. Check movement_custom_signal_tunes.h for options. */
|
||||||
#define SIGNAL_TUNE_DEFAULT
|
#define SIGNAL_TUNE_DEFAULT
|
||||||
|
|||||||
@ -28,6 +28,8 @@
|
|||||||
#include "thermistor_driver.h"
|
#include "thermistor_driver.h"
|
||||||
#include "watch.h"
|
#include "watch.h"
|
||||||
|
|
||||||
|
static bool skip = false;
|
||||||
|
|
||||||
static void _temperature_display_face_update_display(bool in_fahrenheit) {
|
static void _temperature_display_face_update_display(bool in_fahrenheit) {
|
||||||
float temperature_c = movement_get_temperature();
|
float temperature_c = movement_get_temperature();
|
||||||
if (in_fahrenheit) {
|
if (in_fahrenheit) {
|
||||||
@ -40,11 +42,12 @@ static void _temperature_display_face_update_display(bool in_fahrenheit) {
|
|||||||
void temperature_display_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) watch_face_index;
|
||||||
(void) context_ptr;
|
(void) context_ptr;
|
||||||
|
// if temperature is invalid, we don't have a temperature sensor which means we shouldn't be here.
|
||||||
|
if (movement_get_temperature() == 0xFFFFFFFF) skip = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void temperature_display_face_activate(void *context) {
|
void temperature_display_face_activate(void *context) {
|
||||||
(void) context;
|
(void) context;
|
||||||
watch_display_text_with_fallback(WATCH_POSITION_TOP, "TEMP", "TE");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool temperature_display_face_loop(movement_event_t event, void *context) {
|
bool temperature_display_face_loop(movement_event_t event, void *context) {
|
||||||
@ -56,6 +59,11 @@ bool temperature_display_face_loop(movement_event_t event, void *context) {
|
|||||||
_temperature_display_face_update_display(movement_use_imperial_units());
|
_temperature_display_face_update_display(movement_use_imperial_units());
|
||||||
break;
|
break;
|
||||||
case EVENT_ACTIVATE:
|
case EVENT_ACTIVATE:
|
||||||
|
if (skip) {
|
||||||
|
movement_move_to_next_face();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
watch_display_text_with_fallback(WATCH_POSITION_TOP, "TEMP", "TE");
|
||||||
// force a measurement to be taken immediately.
|
// force a measurement to be taken immediately.
|
||||||
date_time.unit.second = 0;
|
date_time.unit.second = 0;
|
||||||
// fall through
|
// fall through
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user