|
|
@ -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?
|
|
|
|