Skip to content

Commit

Permalink
ESP32 doesn't use TASK_QUEUE_LENGTH (or taskQueue)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Sep 26, 2021
1 parent e5d75ab commit 7f3c7fc
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Sming/Platform/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@
#include "Platform/System.h"
#include "Timer.h"

#ifndef TASK_QUEUE_LENGTH
SystemClass System;
SystemState SystemClass::state = eSS_None;

#ifdef ARCH_ESP32
#undef TASK_QUEUE_LENGTH
#define TASK_QUEUE_LENGTH 0
#define taskQueue nullptr
#else
#ifdef TASK_QUEUE_LENGTH
static_assert(TASK_QUEUE_LENGTH >= 8, "Task queue too small");
#else
/** @brief default number of tasks in global queue
* @note tasks are usually short-lived and executed very promptly, so a large queue is
* normally un-necessry. If queue overrun is suspected, check `SystemClass::getMaxTaskCount()`.
*/
#define TASK_QUEUE_LENGTH 10
#endif

SystemClass System;

SystemState SystemClass::state = eSS_None;
os_event_t SystemClass::taskQueue[TASK_QUEUE_LENGTH];

static_assert(TASK_QUEUE_LENGTH >= 8, "Task queue too small");
#endif

#ifdef ENABLE_TASK_COUNT
volatile uint8_t SystemClass::taskCount;
Expand Down

0 comments on commit 7f3c7fc

Please sign in to comment.