diff options
| author | JF <jf@codingfield.com> | 2020-03-03 18:59:01 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-03-03 18:59:01 (GMT) |
| commit | 545636940f68108a361dda85e0e48a240909cf29 (patch) | |
| tree | f471cf8f60976ab1fffce747db021e5706bf60c2 /src/SystemTask/SystemTask.h | |
| parent | 79b4f006be8732663706f1177e17e52829eb661f (diff) | |
| parent | d2f725ec9bc6d848906b83ca539d873223d74648 (diff) | |
Merge branch 'littlevgl'
# Conflicts:
# src/DisplayApp/Screens/Clock.cpp
# src/DisplayApp/Screens/Clock.h
Diffstat (limited to 'src/SystemTask/SystemTask.h')
| -rw-r--r-- | src/SystemTask/SystemTask.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/SystemTask/SystemTask.h b/src/SystemTask/SystemTask.h new file mode 100644 index 0000000..f5ba2d7 --- /dev/null +++ b/src/SystemTask/SystemTask.h @@ -0,0 +1,62 @@ +#pragma once + +#include <FreeRTOS.h> +#include <task.h> +#include <memory> +#include <drivers/SpiMaster.h> +#include <drivers/St7789.h> +#include <Components/Battery/BatteryController.h> +#include <DisplayApp/DisplayApp.h> +#include <drivers/Watchdog.h> + +namespace Pinetime { + namespace System { + class SystemTask { + public: + enum class Messages {GoToSleep, GoToRunning}; + + SystemTask(Pinetime::Drivers::SpiMaster& spi, + Pinetime::Drivers::St7789& lcd, + Pinetime::Drivers::Cst816S& touchPanel, + Pinetime::Components::LittleVgl& lvgl, + Pinetime::Controllers::Battery& batteryController, + Pinetime::Controllers::Ble& bleController, + Pinetime::Controllers::DateTime& dateTimeController); + + + void Start(); + void PushMessage(Messages msg); + + void OnButtonPushed(); + void OnTouchEvent(); + private: + TaskHandle_t taskHandle; + + Pinetime::Drivers::SpiMaster& spi; + Pinetime::Drivers::St7789& lcd; + Pinetime::Drivers::Cst816S& touchPanel; + Pinetime::Components::LittleVgl& lvgl; + Pinetime::Controllers::Battery& batteryController; + std::unique_ptr<Pinetime::Applications::DisplayApp> displayApp; + Pinetime::Controllers::Ble& bleController; + Pinetime::Controllers::DateTime& dateTimeController; + QueueHandle_t systemTaksMsgQueue; + bool isSleeping = false; + Pinetime::Drivers::Watchdog watchdog; + + + static constexpr uint8_t pinSpiSck = 2; + static constexpr uint8_t pinSpiMosi = 3; + static constexpr uint8_t pinSpiMiso = 4; + static constexpr uint8_t pinSpiCsn = 25; + static constexpr uint8_t pinLcdDataCommand = 18; + static constexpr uint8_t pinButton = 13; + static constexpr uint8_t pinTouchIrq = 28; + + static void Process(void* instance); + void Work(); + + + }; + } +}
\ No newline at end of file |
