From 1d96758acd4e3bf03c3e733a3a95d0deb74f6042 Mon Sep 17 00:00:00 2001 From: Avamander Date: Sun, 4 Oct 2020 15:11:21 +0300 Subject: [PATCH 1/3] Minor #include improvements --- src/displayapp/screens/Tab.cpp | 4 ++-- src/systemtask/SystemTask.cpp | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/displayapp/screens/Tab.cpp b/src/displayapp/screens/Tab.cpp index adc32578..44b806c0 100644 --- a/src/displayapp/screens/Tab.cpp +++ b/src/displayapp/screens/Tab.cpp @@ -1,13 +1,13 @@ #include #include -#include +#include "components/datetime/DateTimeController.h" #include #include #include #include #include #include "Tab.h" -#include +#include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 68f8ab53..0ed99f86 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "../main.h" +#include "main.h" #include "components/ble/NimbleController.h" using namespace Pinetime::System; @@ -36,7 +36,7 @@ SystemTask::SystemTask(Drivers::SpiMaster &spi, Drivers::St7789 &lcd, bleController{bleController}, dateTimeController{dateTimeController}, watchdog{}, watchdogView{watchdog}, notificationManager{notificationManager}, nimbleController(*this, bleController,dateTimeController, notificationManager, batteryController, spiNorFlash) { - systemTaksMsgQueue = xQueueCreate(10, 1); + systemTasksMsgQueue = xQueueCreate(10, 1); } void SystemTask::Start() { @@ -102,7 +102,7 @@ void SystemTask::Work() { while(true) { uint8_t msg; - if (xQueueReceive(systemTaksMsgQueue, &msg, isSleeping?2500 : 1000)) { + if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) { Messages message = static_cast(msg); switch(message) { case Messages::GoToRunning: @@ -191,6 +191,8 @@ void SystemTask::Work() { if(!nrf_gpio_pin_read(pinButton)) watchdog.Kick(); } + // Clear diagnostic suppression + #pragma clang diagnostic pop } void SystemTask::OnButtonPushed() { @@ -228,7 +230,7 @@ void SystemTask::PushMessage(SystemTask::Messages msg) { } BaseType_t xHigherPriorityTaskWoken; xHigherPriorityTaskWoken = pdFALSE; - xQueueSendFromISR(systemTaksMsgQueue, &msg, &xHigherPriorityTaskWoken); + xQueueSendFromISR(systemTasksMsgQueue, &msg, &xHigherPriorityTaskWoken); if (xHigherPriorityTaskWoken) { /* Actual macro used here is port specific. */ // TODO : should I do something here? From 9b7ba7b5b84072e5abbb0c77c7ea5c52cbbb1098 Mon Sep 17 00:00:00 2001 From: Avamander Date: Sun, 4 Oct 2020 15:13:01 +0300 Subject: [PATCH 2/3] Fixed a typo in SystemTask --- src/systemtask/SystemTask.cpp | 6 +++--- src/systemtask/SystemTask.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 68f8ab53..bb3a7728 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -36,7 +36,7 @@ SystemTask::SystemTask(Drivers::SpiMaster &spi, Drivers::St7789 &lcd, bleController{bleController}, dateTimeController{dateTimeController}, watchdog{}, watchdogView{watchdog}, notificationManager{notificationManager}, nimbleController(*this, bleController,dateTimeController, notificationManager, batteryController, spiNorFlash) { - systemTaksMsgQueue = xQueueCreate(10, 1); + systemTasksMsgQueue = xQueueCreate(10, 1); } void SystemTask::Start() { @@ -102,7 +102,7 @@ void SystemTask::Work() { while(true) { uint8_t msg; - if (xQueueReceive(systemTaksMsgQueue, &msg, isSleeping?2500 : 1000)) { + if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping?2500 : 1000)) { Messages message = static_cast(msg); switch(message) { case Messages::GoToRunning: @@ -228,7 +228,7 @@ void SystemTask::PushMessage(SystemTask::Messages msg) { } BaseType_t xHigherPriorityTaskWoken; xHigherPriorityTaskWoken = pdFALSE; - xQueueSendFromISR(systemTaksMsgQueue, &msg, &xHigherPriorityTaskWoken); + xQueueSendFromISR(systemTasksMsgQueue, &msg, &xHigherPriorityTaskWoken); if (xHigherPriorityTaskWoken) { /* Actual macro used here is port specific. */ // TODO : should I do something here? diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index 1be28e3f..6ef0cfbf 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -54,7 +54,7 @@ namespace Pinetime { std::unique_ptr displayApp; Pinetime::Controllers::Ble& bleController; Pinetime::Controllers::DateTime& dateTimeController; - QueueHandle_t systemTaksMsgQueue; + QueueHandle_t systemTasksMsgQueue; std::atomic isSleeping{false}; std::atomic isGoingToSleep{false}; std::atomic isWakingUp{false}; From 77f4d5448bb05287a3802ce3511817fc27a825ab Mon Sep 17 00:00:00 2001 From: Avamander Date: Sun, 4 Oct 2020 15:14:09 +0300 Subject: [PATCH 3/3] Fixed a small warning with Screen's constructor --- src/displayapp/screens/Screen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/displayapp/screens/Screen.h b/src/displayapp/screens/Screen.h index dbf81a44..0a17b4da 100644 --- a/src/displayapp/screens/Screen.h +++ b/src/displayapp/screens/Screen.h @@ -9,7 +9,7 @@ namespace Pinetime { namespace Screens { class Screen { public: - Screen(DisplayApp* app) : app{app} {} + explicit Screen(DisplayApp* app) : app{app} {} virtual ~Screen() = default; // Return false if the app can be closed, true if it must continue to run