mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-09-28 18:57:33 +00:00
Fixed compiler errors
This commit is contained in:
@@ -48,27 +48,13 @@ namespace sta
|
||||
|
||||
void func() override;
|
||||
|
||||
private:
|
||||
class CGuard
|
||||
{
|
||||
public:
|
||||
~CGuard()
|
||||
{
|
||||
if( NULL != Manager::_instance )
|
||||
{
|
||||
delete Manager::_instance;
|
||||
Manager::_instance = NULL;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static Manager* _instance;
|
||||
|
||||
private:
|
||||
Manager();
|
||||
|
||||
Manager(const Manager&);
|
||||
|
||||
~Manager() {}
|
||||
//~Manager();
|
||||
|
||||
void updateThreads();
|
||||
|
||||
@@ -77,6 +63,19 @@ namespace sta
|
||||
void stopThreads(uint16_t state);
|
||||
|
||||
std::set<TacosThread> threads_[STA_TACOS_NUM_STATES];
|
||||
|
||||
class CGuard
|
||||
{
|
||||
public:
|
||||
~CGuard()
|
||||
{
|
||||
if( NULL != Manager::_instance )
|
||||
{
|
||||
delete Manager::_instance;
|
||||
Manager::_instance = NULL;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
} // namespace tacos
|
||||
} // namespace sta
|
||||
|
@@ -25,6 +25,8 @@ namespace sta
|
||||
*/
|
||||
TacosThread(const char* name, osPriority_t prio);
|
||||
|
||||
TacosThread();
|
||||
|
||||
virtual ~TacosThread();
|
||||
|
||||
/**
|
||||
@@ -62,7 +64,9 @@ namespace sta
|
||||
* @brief The body of the thread's loop. Has to be implemented by the user.
|
||||
*/
|
||||
virtual void func();
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* @brief Static function to pass to RTOS to run as a thread. Calls the loop function implemented here.
|
||||
*/
|
||||
|
@@ -93,6 +93,10 @@ namespace sta
|
||||
|
||||
}
|
||||
|
||||
//Manager::~Manager(){}
|
||||
|
||||
Manager* Manager::_instance = nullptr;
|
||||
|
||||
} // namespace tacos
|
||||
} // namespace sta
|
||||
|
||||
|
@@ -11,6 +11,8 @@ namespace sta
|
||||
{
|
||||
namespace tacos
|
||||
{
|
||||
Statemachine::Statemachine(){}
|
||||
|
||||
void Statemachine::init()
|
||||
{
|
||||
|
||||
@@ -25,6 +27,9 @@ namespace sta
|
||||
{
|
||||
return currentState_;
|
||||
}
|
||||
|
||||
Statemachine* Statemachine::_instance = nullptr;
|
||||
|
||||
} // namespace tacos
|
||||
} // namespace sta
|
||||
|
||||
|
@@ -20,11 +20,13 @@ namespace sta
|
||||
TacosThread::TacosThread(const char* name, osPriority_t prio)
|
||||
: RtosThread(RtosHandle<osThreadId_t>(Handle::Deferred(&instance_))),
|
||||
attribs_{ .name = name, .priority = prio }
|
||||
{
|
||||
{}
|
||||
|
||||
}
|
||||
TacosThread::TacosThread()
|
||||
: RtosThread(RtosHandle<osThreadId_t>(Handle::Deferred(&instance_)))
|
||||
{}
|
||||
|
||||
static void entry_point(void* arg)
|
||||
void TacosThread::entry_point(void* arg)
|
||||
{
|
||||
STA_ASSERT(arg != nullptr);
|
||||
|
||||
@@ -81,6 +83,12 @@ namespace sta
|
||||
{
|
||||
return std::strcmp(this->getName(), other.getName()) < 0;
|
||||
}
|
||||
|
||||
void TacosThread::init(){}
|
||||
void TacosThread::func(){}
|
||||
|
||||
TacosThread::~TacosThread(){}
|
||||
|
||||
} // namespace tacos
|
||||
} // namespace sta
|
||||
|
||||
|
Reference in New Issue
Block a user