summaryrefslogtreecommitdiff
path: root/src/displayapp/DisplayAppRecovery.h
diff options
context:
space:
mode:
authorNiall Cooling <niallcooling@gmail.com>2021-03-22 17:23:49 (GMT)
committerNiall Cooling <niallcooling@gmail.com>2021-03-22 17:23:49 (GMT)
commite5e3fc02b8a2adf9ea100c162d1290cecdf617ef (patch)
tree78d4da0239ff8bf7a8694c28f804f81d2496979f /src/displayapp/DisplayAppRecovery.h
parent14bd790701f4e2f6d75ef8a1f52b9f38023c2dd9 (diff)
parent9f9d0eb5df8ff86b9cd1e095afa3159094dde53c (diff)
Updated to include WatchFaceAnalog and fixed clashes
Diffstat (limited to 'src/displayapp/DisplayAppRecovery.h')
-rw-r--r--src/displayapp/DisplayAppRecovery.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h
new file mode 100644
index 0000000..a3f27d2
--- /dev/null
+++ b/src/displayapp/DisplayAppRecovery.h
@@ -0,0 +1,73 @@
+#pragma once
+#include <FreeRTOS.h>
+#include <task.h>
+#include <drivers/St7789.h>
+#include <drivers/SpiMaster.h>
+#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/settings/Settings.h>
+#include "TouchEvents.h"
+#include "Apps.h"
+#include "Messages.h"
+#include "DummyLittleVgl.h"
+
+namespace Pinetime {
+ namespace System {
+ class SystemTask;
+ };
+ namespace Applications {
+ class DisplayApp {
+ public:
+ DisplayApp(Drivers::St7789 &lcd, Components::LittleVgl &lvgl, Drivers::Cst816S &,
+ Controllers::Battery &batteryController, Controllers::Ble &bleController,
+ Controllers::DateTime &dateTimeController, Drivers::WatchdogView &watchdog,
+ System::SystemTask &systemTask,
+ Pinetime::Controllers::NotificationManager& notificationManager,
+ Pinetime::Controllers::HeartRateController& heartRateController,
+ Pinetime::Controllers::Settings& settingsController);
+ void Start();
+ void PushMessage(Pinetime::Applications::Display::Messages msg);
+
+ private:
+ TaskHandle_t taskHandle;
+ static void Process(void* instance);
+ void DisplayLogo(uint16_t color);
+ void DisplayOtaProgress(uint8_t percent, uint16_t color);
+ void InitHw();
+ void Refresh();
+ Pinetime::Drivers::St7789& lcd;
+ Controllers::Ble &bleController;
+
+ static constexpr uint8_t queueSize = 10;
+ static constexpr uint8_t itemSize = 1;
+ QueueHandle_t msgQueue;
+ static constexpr uint8_t displayWidth = 240;
+ static constexpr uint8_t displayHeight = 240;
+ static constexpr uint8_t bytesPerPixel = 2;
+
+ static constexpr uint16_t colorWhite = 0xFFFF;
+ static constexpr uint16_t colorGreen = 0x07E0;
+ static constexpr uint16_t colorGreenSwapped = 0xE007;
+ static constexpr uint16_t colorBlue = 0x0000ff;
+ static constexpr uint16_t colorRed = 0xff00;
+ static constexpr uint16_t colorRedSwapped = 0x00ff;
+ static constexpr uint16_t colorBlack = 0x0000;
+ uint8_t displayBuffer[displayWidth * bytesPerPixel];
+
+
+ };
+ }
+}
+
+