fixes now compiles

This commit is contained in:
grcasanova
2020-07-06 10:45:55 +02:00
parent d5b8038457
commit 92b30ebec6
29 changed files with 111 additions and 76 deletions

View File

@@ -1,6 +1,6 @@
#pragma once
#include "freertosinc.h"
#include "../freertosinc.h"
namespace concurrency {

View File

@@ -1,7 +1,7 @@
#include "PeriodicScheduler.h"
#include "PeriodicTask.h"
#include "LockGuard.h"
#include "../time.h"
#include "../timing.h"
namespace concurrency {
@@ -10,7 +10,7 @@ void PeriodicScheduler::loop()
{
LockGuard lg(&lock);
uint32_t now = time::millis();
uint32_t now = timing::millis();
for (auto t : tasks) {
if (t->period && (now - t->lastMsec) >= t->period) {

View File

@@ -1,16 +1,16 @@
#pragma once
#include "PeriodicScheduler.h"
#include "../time.h"
#include "timing.h"
namespace concurrency {
/**
* A base class for tasks that want their doTask() method invoked periodically
* @brief A base class for tasks that want their doTask() method invoked periodically
*
* FIXME: currently just syntatic sugar for polling in loop (you must call .loop), but eventually
* generalize with the freertos scheduler so we can save lots of power by having everything either in
* something like this or triggered off of an irq.
* @todo currently just syntatic sugar for polling in loop (you must call .loop), but eventually
* generalize with the freertos scheduler so we can save lots of power by having everything either in
* something like this or triggered off of an irq.
*/
class PeriodicTask
{
@@ -27,7 +27,8 @@ class PeriodicTask
*/
PeriodicTask(uint32_t initialPeriod = 1);
/** MUST be be called once at startup (but after threading is running - i.e. not from a constructor)
/**
* MUST be be called once at startup (but after threading is running - i.e. not from a constructor)
*/
void setup();
@@ -37,7 +38,7 @@ class PeriodicTask
*/
void setPeriod(uint32_t p)
{
lastMsec = time::millis(); // reset starting from now
lastMsec = timing::millis(); // reset starting from now
period = p;
}

View File

@@ -1,5 +1,5 @@
#include "WorkerThread.h"
#include "debug.h"
#include "timing.h"
namespace concurrency {
@@ -10,8 +10,8 @@ void WorkerThread::doRun()
#ifdef DEBUG_STACK
static uint32_t lastPrint = 0;
if (millis() - lastPrint > 10 * 1000L) {
lastPrint = millis();
if (timing::millis() - lastPrint > 10 * 1000L) {
lastPrint = timing::millis();
uint32_t taskHandle = reinterpret_cast<uint32_t>(xTaskGetCurrentTaskHandle());
DEBUG_MSG("printThreadInfo(%s) task: %" PRIx32 " core id: %u min free stack: %u\n", "thread", taskHandle, xPortGetCoreID(),
uxTaskGetStackHighWaterMark(nullptr));