README.md aktualisiert

This commit is contained in:
dario 2024-12-07 13:53:57 +00:00
parent aa21c44270
commit 1f9af8ebc0

View File

@ -84,25 +84,13 @@ In order to use TACOS, you need to provide a configuration file in the path `sta
#ifndef INC_STA_CONFIG_HPP_
#define INC_STA_CONFIG_HPP_
// Using a board with an ASEAG module present.
#define STA_STM32_ASEAG
// Use the STM32F407 microprocessor.
#include <sta/devices/stm32/mcu/STM32F407xx.hpp>
// Doesn't really do too much right now. Has to be added for successful compilation.
#define STA_PRINTF_USE_STDLIB
// Enable debug serial output and assertions.
#define STA_ASSERT_FORCE
#define STA_ASSERT_ENABLED
#define STA_DEBUGGING_ENABLED
// Enable Features
#define STA_RTOS_SYSTEM_EVENTS_ENABLE
// #define STA_RTOS_SYSTEM_WATCHDOG_ENABLE
// #define STA_RTOS_WATCHDOG_ENABLE
// #define STA_TACOS_WATCHDOG_FREQUENCY 10000
#define STA_CAN_BUS_ENABLE
// Statemachine settings.
#define STA_TACOS_NUM_STATES 3
@ -118,6 +106,9 @@ PS: For not officially supported chips use this as the include:
#define STA_PLATFORM_STM32
```
> [!WARNING]
> If you want to use debug printing (enabled using the macro `STA_DEBUGGING_ENABLED`) in a TACOS project, you should also enable float formatting under `Project Settings -> C/C++ Build -> MPU/MCU Settings -> Use float with printf from newlib-nano`. This allows you to format print floats using `STA_DEBUG_PRINTF`.
### Implementing your own threads
Let's create a simple thread that prints "Hello World" every second. First create a new file in the `App/Inc/tasks` folder called `spam_task.hpp`. Then add the following code:
@ -148,6 +139,7 @@ This code defines a new thread that inherits from `TacosThread` and implements t
Now create a new file in the `App/Src/tasks` folder called `spam_task.cpp` and add the following code:
```cpp
#include <tasks/spam_task.hpp>
#include <sta/debug/debug.hpp>
namespace tasks {
SpamTask::SpamTask() :