mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-09-29 02:57:33 +00:00
Added a simple API for TACOS
This commit is contained in:
39
src/tacos.cpp
Normal file
39
src/tacos.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* tacos.cpp
|
||||
*
|
||||
* Created on: Jan 2, 2024
|
||||
* Author: Dario
|
||||
*/
|
||||
|
||||
#include <sta/tacos.hpp>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
namespace tacos
|
||||
{
|
||||
uint16_t getState()
|
||||
{
|
||||
return Statemachine::instance()->getCurrentState();
|
||||
}
|
||||
|
||||
void setState(uint32_t from, uint32_t to, uint32_t lockout /* = 0 */)
|
||||
{
|
||||
Statemachine::instance()->requestStateTransition(from, to, lockout);
|
||||
}
|
||||
|
||||
void setStateTimed(uint32_t from, uint32_t to, uint32_t millis, uint32_t lockout /* = 0 */)
|
||||
{
|
||||
Statemachine::instance()->requestTimedStateTransition(from, to, millis, lockout);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void addThread(std::list<uint16_t> states, std::initializer_list<T> args)
|
||||
{
|
||||
Manager::instance()->registerThread(std::make_shared<T>(args), states);
|
||||
}
|
||||
} // namespace tacos
|
||||
|
||||
} // namespace sta
|
||||
|
||||
|
Reference in New Issue
Block a user