mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-06-12 01:25:59 +00:00
Fix: rebase error
This commit is contained in:
parent
db5e60f9fc
commit
ee69e3222f
@ -22,39 +22,20 @@ namespace sta
|
|||||||
TacosThread::TacosThread(const char* name, osPriority_t prio, uint32_t stack_size /* = 0 */, uint32_t cb_size /* = 0 */)
|
TacosThread::TacosThread(const char* name, osPriority_t prio, uint32_t stack_size /* = 0 */, uint32_t cb_size /* = 0 */)
|
||||||
: RtosThread(name, prio, stack_size, cb_size),
|
: RtosThread(name, prio, stack_size, cb_size),
|
||||||
instance_{ NULL },
|
instance_{ NULL },
|
||||||
attribs_{ .name = name, .priority = prio },
|
attribs_{ .name=name, .cb_size=cb_size, .stack_size=stack_size, .priority=prio },
|
||||||
running_{false}
|
running_{false},
|
||||||
{}
|
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
||||||
|
status_{ThreadStatus::STOPPED},
|
||||||
TacosThread::TacosThread()
|
#endif // STA_TACOS_WATCHDOG_ENABLED
|
||||||
: RtosThread(RtosHandle<osThreadId_t>(Handle::Deferred(&instance_))),
|
#ifdef STA_CAN_BUS_ENABLE
|
||||||
instance_{ NULL },
|
CAN_queue_{STA_RTOS_CAN_BUS_QUEUE_LENGTH},
|
||||||
attribs_{ },
|
canID_{0},
|
||||||
running_{false}
|
#endif // STA_CAN_BUS_ENABLE
|
||||||
{}
|
terminate_{false},
|
||||||
|
previous_tick_{0}
|
||||||
void TacosThread::entry_point(void* arg)
|
|
||||||
{
|
{
|
||||||
STA_ASSERT(arg != nullptr);
|
STA_ASSERT(stack_size >= 0);
|
||||||
|
STA_ASSERT(cb_size >= 0);
|
||||||
TacosThread* instance = reinterpret_cast<TacosThread*>(arg) ;
|
|
||||||
instance->loop();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TacosThread::start()
|
|
||||||
{
|
|
||||||
STA_ASSERT(!isRunning());
|
|
||||||
|
|
||||||
// If this is the first time starting the thread, it has to be started via rtos first.
|
|
||||||
if (instance_ == NULL)
|
|
||||||
{
|
|
||||||
instance_ = osThreadNew(entry_point, this, &attribs_);
|
|
||||||
|
|
||||||
STA_ASSERT(instance_ != NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send a thread start signal.
|
|
||||||
sysNotify(STA_RTOS_THREAD_FLAG_START);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TacosThread::isRunning()
|
bool TacosThread::isRunning()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user