mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-06 17:47:34 +00:00
Working manager & statemachine tasks; timers still bugged; statemachine init bugged
This commit is contained in:
@@ -11,6 +11,20 @@
|
||||
#include <sta/config.hpp>
|
||||
|
||||
#include <sta/tacos/thread.hpp>
|
||||
#include <sta/rtos/timer.hpp>
|
||||
|
||||
#include <sta/debug/assert.hpp>
|
||||
|
||||
|
||||
#ifndef STA_TACOS_NUM_STATES
|
||||
# error "Number of states wasn't defined in config.hpp"
|
||||
#else
|
||||
|
||||
|
||||
#ifndef STA_TACOS_INITIAL_STATE
|
||||
# define STA_TACOS_INITIAL_STATE 0
|
||||
#endif
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
@@ -27,9 +41,6 @@ namespace sta
|
||||
{
|
||||
// Create a the manager singleton instance.
|
||||
Statemachine::_instance = new Statemachine();
|
||||
|
||||
// Start the manager task as a tacos task.
|
||||
Statemachine::_instance->start();
|
||||
}
|
||||
|
||||
return _instance;
|
||||
@@ -39,7 +50,7 @@ namespace sta
|
||||
|
||||
void func() override;
|
||||
|
||||
uint16_t getCurrentState();
|
||||
uint16_t getCurrentState() const;
|
||||
|
||||
private:
|
||||
static Statemachine * _instance;
|
||||
@@ -63,11 +74,17 @@ namespace sta
|
||||
|
||||
~Statemachine() {}
|
||||
|
||||
private:
|
||||
static void forceStateChange(void * arg);
|
||||
|
||||
private:
|
||||
uint16_t currentState_;
|
||||
RtosTimer lockoutTimer_;
|
||||
RtosTimer failsafeTimer_;
|
||||
};
|
||||
} // namespace tacos
|
||||
} // namespace sta
|
||||
|
||||
|
||||
#endif // STA_TACOS_NUM_STATES
|
||||
|
||||
#endif /* INCLUDE_TACOS_STATEMACHINE_HPP_ */
|
||||
|
Reference in New Issue
Block a user