something 'It worked on my machine' something

This commit is contained in:
dario
2024-12-07 19:28:34 +01:00
parent 3cb196d6e7
commit 7895b551fd
457 changed files with 71354 additions and 83 deletions

View File

@@ -0,0 +1,23 @@
/*
* config.hpp
*
* Created on: Dec 31, 2023
* Author: Dario
*/
#ifndef STA_CONFIG_HPP
#define STA_CONFIG_HPP
#define STA_STM32_ASEAG
#include <sta/devices/stm32/mcu/STM32F407xx.hpp>
// Enable debug serial output and assertions.
#define STA_ASSERT_ENABLED
#define STA_DEBUGGING_ENABLED
// Use the default configs for TACOS
#include <sta/tacos/configs/default.hpp>
#define STA_TACOS_NUM_STATES 3
#endif // STA_CONFIG_HPP

View File

@@ -0,0 +1,20 @@
#ifndef INC_TASKS_SPAM_TASK_HPP_
#define INC_TASKS_SPAM_TASK_HPP_
#include <sta/tacos.hpp>
namespace tasks
{
class SpamTask : public sta::tacos::TacosThread {
public:
SpamTask();
// One time function that is called when the thread is created.
void init() override;
// Repeatable function that is called every time the thread is executed.
void func() override;
};
} // namespace tasks
#endif /* INC_TASKS_SPAM_TASK_HPP_ */

19
App/src/startup.cpp Normal file
View File

@@ -0,0 +1,19 @@
#include <sta/tacos.hpp>
#include <tasks/spam_task.hpp>
#include <sta/debug/debug.hpp>
namespace sta
{
namespace tacos
{
void startup()
{
// ###### Register different threads for different states here. ######
// Register a "Spam Task" thread for all states except 1 and 2.
sta::tacos::addThread<tasks::SpamTask>(ALL_STATES - state_set{1,2});
STA_DEBUG_PRINTF("The answer to everything is %d", 42);
}
} // namespace tacos
} // namespace sta

View File

@@ -0,0 +1,17 @@
#include <tasks/spam_task.hpp>
#include <sta/debug/debug.hpp>
namespace tasks {
SpamTask::SpamTask() :
TacosThread("SPAM", osPriorityNormal){}
void SpamTask::init() {
// Nothing to init...
}
void SpamTask::func() {
// Print "Hello World" every second.
STA_DEBUG_PRINTLN("Hello World");
this->periodicDelay(1); // Execute this function with 1 Hz.
}
} // namespace tasks