mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-12 02:36:00 +00:00
46 lines
1.8 KiB
C++
46 lines
1.8 KiB
C++
/**
|
|
* @brief Helper for easy system task setup in `<sta/config.hpp>`.
|
|
*
|
|
* Configuration:
|
|
* STA_OS2_SYSTEM_TASKS_ENABLE: Enable all system tasks and required features
|
|
* STA_OS2_WATCHDOG_TIMER_NAME: Set watchdog timer handle and callback names based on this
|
|
* STA_OS2_WATCHDOG_NAME: Set watchdog task handle and entry function names based on this
|
|
*/
|
|
#ifndef STA_OS2_EASY_CONFIG_HPP
|
|
#define STA_OS2_EASY_CONFIG_HPP
|
|
|
|
#if !defined(STA_CONFIG_HPP) && !defined(STA_OS2_EASY_CONFIG_NO_WARNING)
|
|
#warning "Intended for use in <sta/config.hpp>"
|
|
#endif // !STA_CONFIG_HPP && !STA_OS2_EASY_CONFIG_NO_WARNING
|
|
|
|
|
|
#ifdef STA_OS2_SYSTEM_TASKS_ENABLE
|
|
// Enable system events used by system tasks
|
|
# define STA_OS2_SYSTEM_EVENT_ENABLE
|
|
// Enable system tasks
|
|
# define STA_OS2_WATCHDOG_ENABLE
|
|
# define STA_OS2_STARTUP_ENABLE
|
|
#endif // STA_OS2_SYSTEM_TASKS_ENABLE
|
|
|
|
|
|
#define _STA_OS2_CONCAT(a, b) a ## b
|
|
|
|
#define STA_OS2_MAKE_HANDLE_NAME(name) _STA_OS2_CONCAT(name, Handle)
|
|
#define STA_OS2_MAKE_CALLBACK_NAME(name) _STA_OS2_CONCAT(name, Callback)
|
|
#define STA_OS2_MAKE_TASK_NAME(name) _STA_OS2_CONCAT(name, Task)
|
|
|
|
// Use common base name for watchdog timer handle and callback
|
|
#ifdef STA_OS2_WATCHDOG_TIMER_NAME
|
|
# define STA_OS2_WATCHDOG_TIMER_HANDLE STA_OS2_MAKE_HANDLE_NAME(STA_OS2_WATCHDOG_TIMER_NAME)
|
|
# define STA_OS2_WATCHDOG_TIMER_CALLBACK STA_OS2_MAKE_CALLBACK_NAME(STA_OS2_WATCHDOG_TIMER_NAME)
|
|
#endif // STA_OS2_WATCHDOG_TIMER_NAME
|
|
|
|
// Use common base name for watchdog task handle and entry function
|
|
#ifdef STA_OS2_WATCHDOG_NAME
|
|
# define STA_OS2_WATCHDOG_HANDLE STA_OS2_MAKE_HANDLE_NAME(STA_OS2_WATCHDOG_NAME)
|
|
# define STA_OS2_WATCHDOG_ENTRY_FUNCTION STA_OS2_MAKE_TASK_NAME(STA_OS2_WATCHDOG_NAME)
|
|
#endif // STA_OS2_WATCHDOG_NAME
|
|
|
|
|
|
#endif // STA_OS2_EASY_CONFIG_HPP
|