mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-02 16:51:53 +00:00
Added working blocking-wrapper
This commit is contained in:
parent
05ddf1fb03
commit
12d6303f2e
@ -12,4 +12,4 @@
|
|||||||
// Per default, we assume state 0 to be the initial state.
|
// Per default, we assume state 0 to be the initial state.
|
||||||
#define STA_TACOS_INITIAL_STATE 0
|
#define STA_TACOS_INITIAL_STATE 0
|
||||||
|
|
||||||
#endif // STA_TACOS_CONFIGS_DEFAULT_HPP
|
#endif // STA_TACOS_CONFIGS_DEFAULT_HPP
|
||||||
|
@ -127,7 +127,14 @@ namespace sta
|
|||||||
virtual void cleanup();
|
virtual void cleanup();
|
||||||
|
|
||||||
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
||||||
#define BLOCKING(stmt) waiting(); stmt heartbeat()
|
/**
|
||||||
|
* @brief This macro wraps a given statement into waiting() and heartbeat() to make the code more readable.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define blocking(...) \
|
||||||
|
waiting(); \
|
||||||
|
__VA_ARGS__ \
|
||||||
|
heartbeat(); \
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
@ -23,9 +23,9 @@ namespace sta
|
|||||||
: RtosThread(RtosHandle<osThreadId_t>(Handle::Deferred(&instance_))),
|
: RtosThread(RtosHandle<osThreadId_t>(Handle::Deferred(&instance_))),
|
||||||
instance_{ NULL },
|
instance_{ NULL },
|
||||||
attribs_{ .name = name, .priority = prio },
|
attribs_{ .name = name, .priority = prio },
|
||||||
running_{false},
|
running_{false}
|
||||||
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
||||||
status_{ThreadStatus::STOPPED}
|
, status_{ThreadStatus::STOPPED}
|
||||||
#endif // STA_TACOS_WATCHDOG_ENABLED
|
#endif // STA_TACOS_WATCHDOG_ENABLED
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -33,9 +33,9 @@ namespace sta
|
|||||||
: RtosThread(RtosHandle<osThreadId_t>(Handle::Deferred(&instance_))),
|
: RtosThread(RtosHandle<osThreadId_t>(Handle::Deferred(&instance_))),
|
||||||
instance_{ NULL },
|
instance_{ NULL },
|
||||||
attribs_{ },
|
attribs_{ },
|
||||||
running_{false},
|
running_{false}
|
||||||
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
#ifdef STA_TACOS_WATCHDOG_ENABLED
|
||||||
status_{ThreadStatus::STOPPED}
|
, status_{ThreadStatus::STOPPED}
|
||||||
#endif // STA_TACOS_WATCHDOG_ENABLED
|
#endif // STA_TACOS_WATCHDOG_ENABLED
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user