diff options
| author | Mark Russell <mruss660@gmail.com> | 2021-09-16 20:12:20 (GMT) |
|---|---|---|
| committer | Mark Russell <mruss660@gmail.com> | 2021-09-16 20:12:20 (GMT) |
| commit | cdf99b08f42c3826a8608d756bc7cda0a476ed98 (patch) | |
| tree | cd30018ebb68be09653b589ae11647ca33d40c73 /src/displayapp | |
| parent | 1d43adcdfa7bd15ba45c0c9d7c59c0ff99176b9c (diff) | |
Revert "Merge upstream"
This reverts commit 1d43adcdfa7bd15ba45c0c9d7c59c0ff99176b9c.
Diffstat (limited to 'src/displayapp')
| -rw-r--r-- | src/displayapp/DisplayApp.cpp | 6 | ||||
| -rw-r--r-- | src/displayapp/DisplayAppRecovery.cpp | 1 | ||||
| -rw-r--r-- | src/displayapp/DisplayAppRecovery.h | 32 | ||||
| -rw-r--r-- | src/displayapp/Messages.h | 1 | ||||
| -rw-r--r-- | src/displayapp/screens/BatteryInfo.cpp | 2 | ||||
| -rw-r--r-- | src/displayapp/screens/Notifications.cpp | 2 | ||||
| -rw-r--r-- | src/displayapp/screens/Notifications.h | 8 | ||||
| -rw-r--r-- | src/displayapp/screens/settings/Settings.cpp | 4 |
8 files changed, 33 insertions, 23 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 9d47310..33c67e2 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -139,6 +139,9 @@ void DisplayApp::InitHw() { brightnessController.Set(settingsController.GetBrightness()); } +uint32_t acc = 0; +uint32_t count = 0; +bool toggle = true; void DisplayApp::Refresh() { TickType_t queueTimeout; TickType_t delta; @@ -194,6 +197,9 @@ void DisplayApp::Refresh() { // clockScreen.SetBleConnectionState(bleController.IsConnected() ? Screens::Clock::BleConnectionStates::Connected : // Screens::Clock::BleConnectionStates::NotConnected); break; + case Messages::UpdateBatteryLevel: + batteryController.Update(); + break; case Messages::NewNotification: LoadApp(Apps::NotificationsPreview, DisplayApp::FullRefreshDirections::Down); break; diff --git a/src/displayapp/DisplayAppRecovery.cpp b/src/displayapp/DisplayAppRecovery.cpp index 7a20262..17612ef 100644 --- a/src/displayapp/DisplayAppRecovery.cpp +++ b/src/displayapp/DisplayAppRecovery.cpp @@ -5,7 +5,6 @@ #include <components/rle/RleDecoder.h> #include <touchhandler/TouchHandler.h> #include "displayapp/icons/infinitime/infinitime-nb.c" -#include "components/ble/BleController.h" using namespace Pinetime::Applications; diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index 4184ea4..8b2bc7f 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -6,38 +6,32 @@ #include <bits/unique_ptr.h> #include <queue.h> #include "components/gfx/Gfx.h" +#include "components/battery/BatteryController.h" +#include "components/brightness/BrightnessController.h" +#include "components/ble/BleController.h" +#include "components/datetime/DateTimeController.h" +#include "components/ble/NotificationManager.h" +#include "components/firmwarevalidator/FirmwareValidator.h" #include "drivers/Cst816s.h" #include <date/date.h> #include <drivers/Watchdog.h> +#include <components/heartrate/HeartRateController.h> +#include <components/motion/MotionController.h> #include <components/motor/MotorController.h> +#include <components/settings/Settings.h> #include "TouchEvents.h" #include "Apps.h" #include "Messages.h" #include "DummyLittleVgl.h" +#include "components/timer/TimerController.h" namespace Pinetime { - namespace Drivers { - class St7789; - class Cst816S; - class WatchdogView; - } - namespace Controllers { - class Settings; - class Battery; - class Ble; - class DateTime; - class NotificationManager; - class HeartRateController; - class MotionController; - class TouchHandler; - class MotorController; - class TimerController; - } - namespace System { class SystemTask; }; - + namespace Controllers { + class TouchHandler; + } namespace Applications { class DisplayApp { public: diff --git a/src/displayapp/Messages.h b/src/displayapp/Messages.h index d48b646..c23cdfe 100644 --- a/src/displayapp/Messages.h +++ b/src/displayapp/Messages.h @@ -7,6 +7,7 @@ namespace Pinetime { GoToRunning, UpdateDateTime, UpdateBleConnection, + UpdateBatteryLevel, TouchEvent, ButtonPushed, NewNotification, diff --git a/src/displayapp/screens/BatteryInfo.cpp b/src/displayapp/screens/BatteryInfo.cpp index ad9af15..91c2651 100644 --- a/src/displayapp/screens/BatteryInfo.cpp +++ b/src/displayapp/screens/BatteryInfo.cpp @@ -55,6 +55,8 @@ BatteryInfo::~BatteryInfo() { void BatteryInfo::Refresh() { + batteryController.Update(); + batteryPercent = batteryController.PercentRemaining(); batteryVoltage = batteryController.Voltage(); diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 417dff0..22eb290 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -152,7 +152,7 @@ Notifications::NotificationItem::NotificationItem(const char* title, uint8_t notifNb, Modes mode, Pinetime::Controllers::AlertNotificationService& alertNotificationService) - : mode {mode}, alertNotificationService {alertNotificationService} { + : notifNr {notifNr}, notifNb {notifNb}, mode {mode}, alertNotificationService {alertNotificationService} { lv_obj_t* container1 = lv_cont_create(lv_scr_act(), NULL); lv_obj_set_style_local_bg_color(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x222222)); diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index 0b5271e..f6f8b4c 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -43,13 +43,21 @@ namespace Pinetime { void OnCallButtonEvent(lv_obj_t*, lv_event_t event); private: + uint8_t notifNr = 0; + uint8_t notifNb = 0; + char pageText[4]; + lv_obj_t* container1; + lv_obj_t* t1; + lv_obj_t* l1; + lv_obj_t* l2; lv_obj_t* bt_accept; lv_obj_t* bt_mute; lv_obj_t* bt_reject; lv_obj_t* label_accept; lv_obj_t* label_mute; lv_obj_t* label_reject; + lv_obj_t* bottomPlaceholder; Modes mode; Pinetime::Controllers::AlertNotificationService& alertNotificationService; bool running = true; diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp index e3319f0..f82b03c 100644 --- a/src/displayapp/screens/settings/Settings.cpp +++ b/src/displayapp/screens/settings/Settings.cpp @@ -50,8 +50,8 @@ std::unique_ptr<Screen> Settings::CreateScreen2() { std::array<Screens::List::Applications, 4> applications {{ {Symbols::shoe, "Steps", Apps::SettingSteps}, {Symbols::batteryHalf, "Battery", Apps::BatteryInfo}, - {Symbols::paintbrush, "PTS Colors", Apps::SettingPineTimeStyle}, {Symbols::check, "Firmware", Apps::FirmwareValidation}, + {Symbols::list, "About", Apps::SysInfo}, }}; return std::make_unique<Screens::List>(1, 3, app, settingsController, applications); @@ -60,7 +60,7 @@ std::unique_ptr<Screen> Settings::CreateScreen2() { std::unique_ptr<Screen> Settings::CreateScreen3() { std::array<Screens::List::Applications, 4> applications {{ - {Symbols::list, "About", Apps::SysInfo}, + {Symbols::paintbrush, "PTS Colors", Apps::SettingPineTimeStyle}, {Symbols::none, "None", Apps::None}, {Symbols::none, "None", Apps::None}, {Symbols::none, "None", Apps::None}, |
