From e65c9fa18138e8623d5f8e5e8f25fcf0e3d3cf67 Mon Sep 17 00:00:00 2001 From: JF Date: Mon, 10 Feb 2020 21:05:33 +0100 Subject: Integration of lvgl : continued... --- src/DisplayApp/DisplayApp.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/DisplayApp/DisplayApp.cpp') diff --git a/src/DisplayApp/DisplayApp.cpp b/src/DisplayApp/DisplayApp.cpp index d2bf1bc3..d29027fb 100644 --- a/src/DisplayApp/DisplayApp.cpp +++ b/src/DisplayApp/DisplayApp.cpp @@ -12,18 +12,19 @@ #include #include #include -#include "lv_port_disp.h" using namespace Pinetime::Applications; DisplayApp::DisplayApp(Pinetime::Drivers::St7789& lcd, Pinetime::Components::Gfx& gfx, + Pinetime::Components::LittleVgl& lvgl, Pinetime::Drivers::Cst816S& touchPanel, Controllers::Battery &batteryController, Controllers::Ble &bleController, Controllers::DateTime &dateTimeController) : lcd{lcd}, gfx{gfx}, + lvgl{lvgl}, touchPanel{touchPanel}, batteryController{batteryController}, bleController{bleController}, @@ -31,7 +32,7 @@ DisplayApp::DisplayApp(Pinetime::Drivers::St7789& lcd, clockScreen{gfx}, messageScreen{gfx}{ msgQueue = xQueueCreate(queueSize, itemSize); - currentScreen = &messageScreen; + currentScreen = &clockScreen; } void DisplayApp::Start() { @@ -43,12 +44,15 @@ void DisplayApp::Process(void *instance) { auto *app = static_cast(instance); NRF_LOG_INFO("DisplayApp task started!"); app->InitHw(); - lv_init(); - lv_port_disp_init(); while (1) { - lv_task_handler(); + app->Refresh(); + + auto before = nrf_rtc_counter_get(portNRF_RTC_REG); + lv_task_handler(); + auto after = nrf_rtc_counter_get(portNRF_RTC_REG); + NRF_LOG_INFO("duration : %d", (after-before)); } } @@ -59,8 +63,6 @@ void DisplayApp::InitHw() { nrf_gpio_pin_clear(pinLcdBacklight1); nrf_gpio_pin_clear(pinLcdBacklight2); nrf_gpio_pin_clear(pinLcdBacklight3); - - } uint32_t acc = 0; @@ -75,10 +77,10 @@ void DisplayApp::Refresh() { break; case States::Running: RunningState(); - queueTimeout = 1000; + queueTimeout = 1; break; } - +/* Messages msg; if (xQueueReceive(msgQueue, &msg, queueTimeout)) { switch (msg) { @@ -117,6 +119,7 @@ void DisplayApp::Refresh() { break; } } + */ } bool first = true; -- cgit v1.2.3