mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-06 09:37:34 +00:00
feat: user definable callback on state transition
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
#include <sta/rtos/event.hpp>
|
||||
#include <sta/event.hpp>
|
||||
#include <sta/debug/assert.hpp>
|
||||
#include <sta/lang.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <tuple>
|
||||
@@ -278,6 +279,18 @@ namespace sta
|
||||
*/
|
||||
std::vector<std::shared_ptr<TacosThread>> threads_[STA_TACOS_NUM_STATES];
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Callback that is called when a state transition occurs.
|
||||
*
|
||||
* @param from The state we transitioned from.
|
||||
* @param to The state we transitioned to.
|
||||
* @param lockout The lockout time after the transition.
|
||||
*
|
||||
* @ingroup tacos_statemachine
|
||||
*/
|
||||
STA_WEAK
|
||||
void onStateTransition(uint16_t from, uint16_t to, uint32_t lockout){}
|
||||
} // namespace tacos
|
||||
} // namespace sta
|
||||
|
||||
|
Reference in New Issue
Block a user