diff options
| author | JF <jf@codingfield.com> | 2020-02-23 13:44:39 +0100 |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-02-23 13:44:39 +0100 |
| commit | 02772b996fb26146cf38fc6deccff7f43a49dfd6 (patch) | |
| tree | f2ff90c577f68ccb44b6470621bf87e68a49aed8 /src/DisplayApp/DisplayApp.h | |
| parent | 2bdff7ed2b490cb8ce5599341e12d707c0ba7fd0 (diff) | |
Do not compile GFX and older fonts anymore.
Refactor SystemTask in its own class.
Refactor Screen to be able to close current screen and open a new one.
Re-enable sleep/wake up and propagate button event to Screens.
Diffstat (limited to 'src/DisplayApp/DisplayApp.h')
| -rw-r--r-- | src/DisplayApp/DisplayApp.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/DisplayApp/DisplayApp.h b/src/DisplayApp/DisplayApp.h index f8101536..656dd4ed 100644 --- a/src/DisplayApp/DisplayApp.h +++ b/src/DisplayApp/DisplayApp.h @@ -14,35 +14,37 @@ #include "LittleVgl.h" #include <date/date.h> #include <DisplayApp/Screens/Clock.h> -#include <DisplayApp/Screens/Message.h> +//#include <DisplayApp/Screens/Message.h> -extern const FONT_INFO lCD_70ptFontInfo; namespace Pinetime { + namespace System { + class SystemTask; + }; namespace Applications { class DisplayApp { public: enum class States {Idle, Running}; enum class Messages : uint8_t {GoToSleep, GoToRunning, UpdateDateTime, UpdateBleConnection, UpdateBatteryLevel, TouchEvent, SwitchScreen,ButtonPushed} ; DisplayApp(Pinetime::Drivers::St7789& lcd, - Pinetime::Components::Gfx& gfx, Pinetime::Components::LittleVgl& lvgl, Pinetime::Drivers::Cst816S&, Controllers::Battery &batteryController, Controllers::Ble &bleController, - Controllers::DateTime& dateTimeController); + Controllers::DateTime& dateTimeController, + Pinetime::System::SystemTask& systemTask); void Start(); void PushMessage(Messages msg); + enum class Apps {None, Launcher, Clock, Test}; + void StartApp(Apps app); + private: TaskHandle_t taskHandle; static void Process(void* instance); void InitHw(); Pinetime::Drivers::St7789& lcd; - Pinetime::Components::Gfx& gfx; Pinetime::Components::LittleVgl lvgl; - const FONT_INFO largeFont {lCD_70ptFontInfo.height, lCD_70ptFontInfo.startChar, lCD_70ptFontInfo.endChar, lCD_70ptFontInfo.spacePixels, lCD_70ptFontInfo.charInfo, lCD_70ptFontInfo.data}; - const FONT_INFO smallFont {lCD_14ptFontInfo.height, lCD_14ptFontInfo.startChar, lCD_14ptFontInfo.endChar, lCD_14ptFontInfo.spacePixels, lCD_14ptFontInfo.charInfo, lCD_14ptFontInfo.data}; void Refresh(); States state = States::Running; @@ -66,6 +68,9 @@ namespace Pinetime { static constexpr uint8_t pinLcdBacklight3 = 23; bool isClock = true; + + Pinetime::System::SystemTask& systemTask; + Apps nextApp = Apps::None; }; } } |
