diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-05-12 08:37:08 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-05-12 20:30:57 (GMT) |
| commit | e679896281f3032994f5b998a21140475d167695 (patch) | |
| tree | 702b7714dd847573963c5b802afa936ff1cadb7b /src/displayapp | |
| parent | 1d0023b502563d486a6e8c5d6dffbfdcd4e94c2a (diff) | |
Optimized accelerometer access via system task functions.
Diffstat (limited to 'src/displayapp')
| -rw-r--r-- | src/displayapp/screens/Jumpscore.cpp | 3 | ||||
| -rw-r--r-- | src/displayapp/screens/WatchFaceDigital.cpp | 4 | ||||
| -rw-r--r-- | src/displayapp/screens/WatchFaceDigital.h | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/src/displayapp/screens/Jumpscore.cpp b/src/displayapp/screens/Jumpscore.cpp index 3ec6bcb..81e2d1c 100644 --- a/src/displayapp/screens/Jumpscore.cpp +++ b/src/displayapp/screens/Jumpscore.cpp @@ -91,7 +91,8 @@ Jumpscore::~Jumpscore() { void Jumpscore::Refresh() { double X; double Y; double_t Z; - double G = systemTask.ReadGXYZ(X,Y,Z); + systemTask.ObtainAccel(X,Y,Z); + double G = std::sqrt(X*X + Y*Y + Z*Z); TickType_t current_time = xTaskGetTickCount(); if (started) { TickType_t current_frame_ms = current_time - last_frame_time; diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 79a4640..3b46c3b 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -166,8 +166,7 @@ void WatchFaceDigital::Refresh() { lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); } -#ifndef INFINISIM - temperature = systemTask.motionSensor.temperature_last_read_value+23; + systemTask.ObtainMotionSensorTemperature(temperature); if (temperature.IsUpdated()) { lv_obj_set_style_local_text_color( label_temp, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999)); lv_label_set_text_fmt(label_temp, "%d°C", temperature.Get()); @@ -179,7 +178,6 @@ void WatchFaceDigital::Refresh() { ); #endif } -#endif uint8_t second = dateTimeController.Seconds(); uint8_t decisecond = dateTimeController.Deciseconds(); diff --git a/src/displayapp/screens/WatchFaceDigital.h b/src/displayapp/screens/WatchFaceDigital.h index c29033b..1ef9244 100644 --- a/src/displayapp/screens/WatchFaceDigital.h +++ b/src/displayapp/screens/WatchFaceDigital.h @@ -64,7 +64,7 @@ namespace Pinetime { DirtyValue<uint32_t> stepCount {}; DirtyValue<uint8_t> heartbeat {}; DirtyValue<bool> heartbeatRunning {}; - DirtyValue<uint16_t> temperature {}; + DirtyValue<int8_t> temperature {}; DirtyValue<bool> notificationState {}; lv_obj_t* label_temp; |
