Added basic task creating in manager task

This commit is contained in:
dario
2023-09-01 22:39:14 +02:00
parent ac7237b0bb
commit 96e9213b1a
4 changed files with 49 additions and 5 deletions

View File

@@ -16,8 +16,17 @@
typedef StaticTask_t osStaticThreadDef_t;
extern "C" void outputTask(void *);
void startWorker(void *arg)
{
STA_DEBUG_PRINTLN("STARTED WORKER!");
osThreadExit();
}
extern "C" void startManagerTask(void *)
{
STA_DEBUG_PRINTLN("INITIALIZED MANAGER TASK");
@@ -40,9 +49,17 @@ extern "C" void startManagerTask(void *)
STA_ASSERT_MSG(outputTaskHandle != nullptr, "outputTask initialization failed");
*/
// Create thread using static allocation
const osThreadAttr_t workerAttributes = {};
for (uint8_t i = 0; i < 5; i++)
{
osThreadNew(startWorker, NULL, &workerAttributes);
}
while (true)
{
STA_DEBUG_PRINTLN("PING!");
// STA_DEBUG_PRINTLN("MANAGING!");
}
osThreadExit();