mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-06-12 01:25:59 +00:00
35 lines
524 B
C++
35 lines
524 B
C++
/*
|
|
* 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()
|
|
{
|
|
uint16_t state = sta::tacos::Statemachine::instance()->getCurrentState();
|
|
uint16_t next = 1 - state;
|
|
|
|
sta::tacos::Statemachine::instance()->requestStateTransition(state, next, 5000);
|
|
}
|
|
}
|
|
|
|
|