mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-09-29 02:57:33 +00:00
Added first successful test for statemachine rework
This commit is contained in:
37
App/Src/tasks/toggle.cpp
Normal file
37
App/Src/tasks/toggle.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* toggle.cpp
|
||||
*
|
||||
* Created on: Nov 10, 2023
|
||||
* Author: Dario
|
||||
*/
|
||||
|
||||
#include <tasks/toggle.hpp>
|
||||
#include <sta/tacos/statemachine.hpp>
|
||||
#include <sta/debug/debug.hpp>
|
||||
|
||||
namespace demo
|
||||
{
|
||||
Toggle::Toggle()
|
||||
: sta::tacos::TacosThread{ "Toggle", osPriorityNormal }
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Toggle::init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Toggle::func()
|
||||
{
|
||||
osDelay(5000);
|
||||
|
||||
uint16_t state = sta::tacos::Statemachine::instance()->getCurrentState();
|
||||
uint16_t next = 1 - state;
|
||||
|
||||
STA_DEBUG_PRINTLN("Toggle!");
|
||||
sta::tacos::Statemachine::instance()->requestStateTransition(state, next, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user