add movement_get_temperature, works across different sensor boards

This commit is contained in:
Joey Castillo
2025-05-17 11:03:51 -04:00
parent 80cbb0fe30
commit 47fbaccc77
7 changed files with 26 additions and 28 deletions

View File

@@ -28,17 +28,13 @@
#include "thermistor_driver.h"
#include "watch.h"
#ifdef HAS_TEMPERATURE_SENSOR
static void _temperature_display_face_update_display(bool in_fahrenheit) {
thermistor_driver_enable();
float temperature_c = thermistor_driver_get_temperature();
float temperature_c = movement_get_temperature();
if (in_fahrenheit) {
watch_display_float_with_best_effort(temperature_c * 1.8 + 32.0, "#F");
} else {
watch_display_float_with_best_effort(temperature_c, "#C");
}
thermistor_driver_disable();
}
void temperature_display_face_setup(uint8_t watch_face_index, void ** context_ptr) {
@@ -96,5 +92,3 @@ bool temperature_display_face_loop(movement_event_t event, void *context) {
void temperature_display_face_resign(void *context) {
(void) context;
}
#endif