Merge pull request #81 from Avamander/patch-4

Fixed a typo in SystemTask
main
JF002 2020-10-08 20:56:19 +07:00 committed by GitHub
commit 9d43eff43a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

@ -9,7 +9,7 @@ namespace Pinetime {
namespace Screens { namespace Screens {
class Screen { class Screen {
public: public:
Screen(DisplayApp* app) : app{app} {} explicit Screen(DisplayApp* app) : app{app} {}
virtual ~Screen() = default; virtual ~Screen() = default;
// Return false if the app can be closed, true if it must continue to run // Return false if the app can be closed, true if it must continue to run

@ -1,13 +1,13 @@
#include <cstdio> #include <cstdio>
#include <libs/date/includes/date/date.h> #include <libs/date/includes/date/date.h>
#include <Components/DateTime/DateTimeController.h> #include "components/datetime/DateTimeController.h"
#include <Version.h> #include <Version.h>
#include <libs/lvgl/src/lv_core/lv_obj.h> #include <libs/lvgl/src/lv_core/lv_obj.h>
#include <libs/lvgl/src/lv_font/lv_font.h> #include <libs/lvgl/src/lv_font/lv_font.h>
#include <libs/lvgl/lvgl.h> #include <libs/lvgl/lvgl.h>
#include <libraries/log/nrf_log.h> #include <libraries/log/nrf_log.h>
#include "Tab.h" #include "Tab.h"
#include <DisplayApp/DisplayApp.h> #include "displayapp/DisplayApp.h"
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;

@ -11,7 +11,7 @@
#include <host/ble_gap.h> #include <host/ble_gap.h>
#include <host/util/util.h> #include <host/util/util.h>
#include <drivers/InternalFlash.h> #include <drivers/InternalFlash.h>
#include "../main.h" #include "main.h"
#include "components/ble/NimbleController.h" #include "components/ble/NimbleController.h"
using namespace Pinetime::System; using namespace Pinetime::System;
@ -36,7 +36,7 @@ SystemTask::SystemTask(Drivers::SpiMaster &spi, Drivers::St7789 &lcd,
bleController{bleController}, dateTimeController{dateTimeController}, bleController{bleController}, dateTimeController{dateTimeController},
watchdog{}, watchdogView{watchdog}, notificationManager{notificationManager}, watchdog{}, watchdogView{watchdog}, notificationManager{notificationManager},
nimbleController(*this, bleController,dateTimeController, notificationManager, batteryController, spiNorFlash) { nimbleController(*this, bleController,dateTimeController, notificationManager, batteryController, spiNorFlash) {
systemTaksMsgQueue = xQueueCreate(10, 1); systemTasksMsgQueue = xQueueCreate(10, 1);
} }
void SystemTask::Start() { void SystemTask::Start() {
@ -102,7 +102,7 @@ void SystemTask::Work() {
while(true) { while(true) {
uint8_t msg; uint8_t msg;
if (xQueueReceive(systemTaksMsgQueue, &msg, isSleeping?2500 : 1000)) { if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) {
Messages message = static_cast<Messages >(msg); Messages message = static_cast<Messages >(msg);
switch(message) { switch(message) {
case Messages::GoToRunning: case Messages::GoToRunning:
@ -228,7 +228,7 @@ void SystemTask::PushMessage(SystemTask::Messages msg) {
} }
BaseType_t xHigherPriorityTaskWoken; BaseType_t xHigherPriorityTaskWoken;
xHigherPriorityTaskWoken = pdFALSE; xHigherPriorityTaskWoken = pdFALSE;
xQueueSendFromISR(systemTaksMsgQueue, &msg, &xHigherPriorityTaskWoken); xQueueSendFromISR(systemTasksMsgQueue, &msg, &xHigherPriorityTaskWoken);
if (xHigherPriorityTaskWoken) { if (xHigherPriorityTaskWoken) {
/* Actual macro used here is port specific. */ /* Actual macro used here is port specific. */
// TODO : should I do something here? // TODO : should I do something here?

@ -54,7 +54,7 @@ namespace Pinetime {
std::unique_ptr<Pinetime::Applications::DisplayApp> displayApp; std::unique_ptr<Pinetime::Applications::DisplayApp> displayApp;
Pinetime::Controllers::Ble& bleController; Pinetime::Controllers::Ble& bleController;
Pinetime::Controllers::DateTime& dateTimeController; Pinetime::Controllers::DateTime& dateTimeController;
QueueHandle_t systemTaksMsgQueue; QueueHandle_t systemTasksMsgQueue;
std::atomic<bool> isSleeping{false}; std::atomic<bool> isSleeping{false};
std::atomic<bool> isGoingToSleep{false}; std::atomic<bool> isGoingToSleep{false};
std::atomic<bool> isWakingUp{false}; std::atomic<bool> isWakingUp{false};