/** * @file * @brief Helper for easy system task setup in ``. */ #ifndef STA_RTOS2_EASY_CONFIG_HPP #define STA_RTOS2_EASY_CONFIG_HPP /** * @defgroup rtos2EasyConfig Easy Config * @ingroup rtos2BuildConfig * @brief Helpers for easy RTOS2 module setup. * * Use this header only inside the header of your application. */ #ifdef DOXYGEN /** * @brief Don't warn about use of outside of . * * @ingroup rtos2EasyConfig */ # define STA_RTOS2_EASY_CONFIG_NO_WARNING #endif // DOXYGEN #if !defined(STA_CONFIG_HPP) && !defined(STA_RTOS2_EASY_CONFIG_NO_WARNING) #warning "Intended for use in " #endif // !STA_CONFIG_HPP && !STA_RTOS2_EASY_CONFIG_NO_WARNING #ifdef DOXYGEN /** * @brief Enable all system tasks and required features. * * @ingroup rtos2EasyConfig */ # define STA_RTOS2_EASY_CONFIG_SYSTEM_TASKS_ENABLE #endif // DOXYGEN #ifdef STA_RTOS2_EASY_CONFIG_SYSTEM_TASKS_ENABLE // Enable system events used by system tasks # define STA_RTOS2_SYSTEM_EVENT_ENABLE // Enable system tasks # define STA_RTOS2_WATCHDOG_ENABLE # define STA_RTOS2_STARTUP_ENABLE #endif // STA_RTOS2_EASY_CONFIG_SYSTEM_TASKS_ENABLE #define _STA_RTOS2_CONCAT(a, b) a ## b #define STA_RTOS2_MAKE_HANDLE_NAME(name) _STA_RTOS2_CONCAT(name, Handle) #define STA_RTOS2_MAKE_CALLBACK_NAME(name) _STA_RTOS2_CONCAT(name, Callback) #define STA_RTOS2_MAKE_TASK_NAME(name) _STA_RTOS2_CONCAT(name, Task) #ifdef DOXYGEN /** * @brief Common base name used for watchdog timer handle and callback names. * * @ingroup rtos2EasyConfig */ # define STA_RTOS2_EASY_CONFIG_WATCHDOG_TIMER_NAME #endif // DOXYGEN #ifdef STA_RTOS2_EASY_CONFIG_WATCHDOG_TIMER_NAME # define STA_RTOS2_WATCHDOG_TIMER_HANDLE STA_RTOS2_MAKE_HANDLE_NAME(STA_RTOS2_EASY_CONFIG_WATCHDOG_TIMER_NAME) # define STA_RTOS2_WATCHDOG_TIMER_CALLBACK STA_RTOS2_MAKE_CALLBACK_NAME(STA_RTOS2_EASY_CONFIG_WATCHDOG_TIMER_NAME) #endif // STA_RTOS2_EASY_CONFIG_WATCHDOG_TIMER_NAME #ifdef DOXYGEN /** * @brief Common base name used for watchdog task handle and entry function names. * * @ingroup rtos2EasyConfig */ # define STA_RTOS2_EASY_CONFIG_WATCHDOG_NAME #endif // DOXYGEN #ifdef STA_RTOS2_EASY_CONFIG_WATCHDOG_NAME # define STA_RTOS2_WATCHDOG_HANDLE STA_RTOS2_MAKE_HANDLE_NAME(STA_RTOS2_EASY_CONFIG_WATCHDOG_NAME) # define STA_RTOS2_WATCHDOG_ENTRY_FUNCTION STA_RTOS2_MAKE_TASK_NAME(STA_RTOS2_EASY_CONFIG_WATCHDOG_NAME) #endif // STA_RTOS2_EASY_CONFIG_WATCHDOG_NAME #endif // STA_RTOS2_EASY_CONFIG_HPP