Added dummy task. Still a lot of compiler errors to be fixed

This commit is contained in:
dario
2023-09-22 15:50:26 +02:00
parent 326083e48a
commit 10bcad8203
13 changed files with 88 additions and 387 deletions

View File

@@ -5,38 +5,31 @@
* Author: Dario
*/
#include <cmsis_os2.h>
#include <usart.h>
#include <sta/rtos/mutex.hpp>
#include <sta/devices/stm32/bus/uart.hpp>
#include <sta/debug/printing/printable_uart.hpp>
#include <sta/tacos/startup.hpp>
#include <sta/debug/debug.hpp>
// The UART mutex defined in freertos.c
extern osMutexId_t uartMutexHandle;
#include <sta/tacos/manager.hpp>
#include <tasks/dummy.hpp>
namespace sta
{
// Here the printable used for debugging is defined.
Printable * Debug;
namespace rtos
namespace tacos
{
// Override the weak implementation of startupExtras provided in rtos2-utils.
void startupExtras(void * argument)
void onStatemachineInit()
{
// Initialize the mutex for UART communication.
RtosMutex * mutex = new RtosMutex(&uartMutexHandle);
// Initialize the UART interface and printable object.
UARTSettings settings = { .mode = UARTMode::RX_TX };
STM32UART * intf_ptr = new STM32UART(&huart2, settings, mutex);
Debug = new PrintableUART(intf_ptr);
STA_DEBUG_PRINTLN("UART SUCCESSFULLY INITIALIZED");
STA_DEBUG_PRINTLN("Starting statemachine task!");
}
} // namespace rtos
void onManagerInit()
{
STA_DEBUG_PRINTLN("Starting manager task!");
Manager::instance()->registerThread(demo::DummyTask("A"), {0, 1});
Manager::instance()->registerThread(demo::DummyTask("B"), {1, 2});
Manager::instance()->registerThread(demo::DummyTask("C"), {2, 3});
}
} // namespace tacos
} // namespace sta