mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-06 01:37:33 +00:00
Added thread rework, and cleaned up Tacos startup
This commit is contained in:
@@ -42,7 +42,7 @@ namespace sta
|
||||
namespace tacos
|
||||
{
|
||||
typedef std::function<uint16_t(uint16_t)> state_fn;
|
||||
typedef std::function<void(uint16_t, uint16_t, uint16_t)> timer_fn;
|
||||
typedef std::function<void(uint16_t, uint16_t, uint32_t)> timer_fn;
|
||||
|
||||
|
||||
class Statemachine : public TacosThread
|
||||
@@ -135,6 +135,7 @@ namespace sta
|
||||
|
||||
private:
|
||||
uint16_t currentState_;
|
||||
uint16_t failsafeState_;
|
||||
|
||||
RtosTimer lockoutTimer_;
|
||||
RtosTimer failsafeTimer_;
|
||||
|
@@ -61,13 +61,16 @@ namespace sta
|
||||
/**
|
||||
* @brief This function is executed first when this thread is started.
|
||||
*/
|
||||
virtual void init() = 0;
|
||||
virtual void init();
|
||||
|
||||
/**
|
||||
* @brief The body of the thread's loop. Has to be implemented by the user.
|
||||
*/
|
||||
virtual void func() = 0;
|
||||
|
||||
|
||||
virtual void cleanup();
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
@@ -75,8 +78,10 @@ namespace sta
|
||||
*/
|
||||
static void entry_point(void* arg);
|
||||
|
||||
private:
|
||||
osThreadId_t instance_;
|
||||
osThreadAttr_t attribs_;
|
||||
bool running_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user