mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-02 16:51:53 +00:00
Fixed thread starting to work correctly
This commit is contained in:
parent
1d1c5f4fc2
commit
554e1ab94e
@ -98,6 +98,8 @@ namespace sta
|
|||||||
|
|
||||||
void loop() override;
|
void loop() override;
|
||||||
|
|
||||||
|
void start() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function is executed first when this thread is started.
|
* @brief This function is executed first when this thread is started.
|
||||||
*/
|
*/
|
||||||
@ -158,6 +160,8 @@ namespace sta
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void resetStatus();
|
void resetStatus();
|
||||||
|
|
||||||
|
void watchdogIgnore();
|
||||||
#endif // STA_TACOS_WATCHDOG_ENABLED
|
#endif // STA_TACOS_WATCHDOG_ENABLED
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,6 +38,18 @@ namespace sta
|
|||||||
return running_;
|
return running_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TacosThread::start()
|
||||||
|
{
|
||||||
|
if (getInstance() == NULL)
|
||||||
|
{
|
||||||
|
RtosThread::start();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sysNotify(STA_RTOS_THREAD_FLAG_START);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TacosThread::init() {}
|
void TacosThread::init() {}
|
||||||
|
|
||||||
void TacosThread::loop()
|
void TacosThread::loop()
|
||||||
@ -59,8 +71,11 @@ namespace sta
|
|||||||
while (!isTerminationRequested())
|
while (!isTerminationRequested())
|
||||||
{
|
{
|
||||||
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
||||||
|
if (status_ == ThreadStatus::UNKNOWN)
|
||||||
|
{
|
||||||
// Send a fresh heartbeat signal.
|
// Send a fresh heartbeat signal.
|
||||||
heartbeat();
|
heartbeat();
|
||||||
|
}
|
||||||
#endif // STA_TACOS_WATCHDOG_ENABLED
|
#endif // STA_TACOS_WATCHDOG_ENABLED
|
||||||
|
|
||||||
// Execute user-space implementation.
|
// Execute user-space implementation.
|
||||||
@ -116,6 +131,11 @@ namespace sta
|
|||||||
{
|
{
|
||||||
status_ = ThreadStatus::UNKNOWN;
|
status_ = ThreadStatus::UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TacosThread::watchdogIgnore()
|
||||||
|
{
|
||||||
|
status_ = ThreadStatus::IGNORED;
|
||||||
|
}
|
||||||
#endif // STA_TACOS_WATCHDOG_ENABLED
|
#endif // STA_TACOS_WATCHDOG_ENABLED
|
||||||
|
|
||||||
void TacosThread::requestTermination()
|
void TacosThread::requestTermination()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user