mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-12-16 18:08:04 +00:00
Rename to STA RTOS
This commit is contained in:
85
include/sta/rtos/easy_config.hpp
Normal file
85
include/sta/rtos/easy_config.hpp
Normal file
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Helper for easy system task setup in `<sta/config.hpp>`.
|
||||
*/
|
||||
#ifndef STA_RTOS_EASY_CONFIG_HPP
|
||||
#define STA_RTOS_EASY_CONFIG_HPP
|
||||
|
||||
/**
|
||||
* @defgroup STA_RTOS_EasyConfig Easy Config
|
||||
* @ingroup STA_RTOS_BuildConfig
|
||||
* @brief Helpers for easy RTOS module setup.
|
||||
*
|
||||
* Use this header only inside the <sta/config.hpp> header of your application.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
* @brief Don't warn about use of <rtos2/easy_config.hpp> outside of <sta/config.hpp>.
|
||||
*
|
||||
* @ingroup STA_RTOS_EasyConfig
|
||||
*/
|
||||
# define STA_RTOS_EASY_CONFIG_NO_WARNING
|
||||
#endif // DOXYGEN
|
||||
|
||||
#if !defined(STA_CONFIG_HPP) && !defined(STA_RTOS_EASY_CONFIG_NO_WARNING)
|
||||
#warning "Intended for use in <sta/config.hpp>"
|
||||
#endif // !STA_CONFIG_HPP && !STA_RTOS_EASY_CONFIG_NO_WARNING
|
||||
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
* @brief Enable all system tasks and required features.
|
||||
*
|
||||
* @ingroup STA_RTOS_EasyConfig
|
||||
*/
|
||||
# define STA_RTOS_EASY_CONFIG_SYSTEM_TASKS_ENABLE
|
||||
#endif // DOXYGEN
|
||||
|
||||
#ifdef STA_RTOS_EASY_CONFIG_SYSTEM_TASKS_ENABLE
|
||||
// Enable system events used by system tasks
|
||||
# define STA_RTOS_SYSTEM_EVENT_ENABLE
|
||||
// Enable system tasks
|
||||
# define STA_RTOS_WATCHDOG_ENABLE
|
||||
# define STA_RTOS_STARTUP_ENABLE
|
||||
#endif // STA_RTOS_EASY_CONFIG_SYSTEM_TASKS_ENABLE
|
||||
|
||||
|
||||
#define _STA_RTOS_CONCAT(a, b) a ## b
|
||||
|
||||
#define STA_RTOS_MAKE_HANDLE_NAME(name) _STA_RTOS_CONCAT(name, Handle)
|
||||
#define STA_RTOS_MAKE_CALLBACK_NAME(name) _STA_RTOS_CONCAT(name, Callback)
|
||||
#define STA_RTOS_MAKE_TASK_NAME(name) _STA_RTOS_CONCAT(name, Task)
|
||||
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
* @brief Common base name used for watchdog timer handle and callback names.
|
||||
*
|
||||
* @ingroup STA_RTOS_EasyConfig
|
||||
*/
|
||||
# define STA_RTOS_EASY_CONFIG_WATCHDOG_TIMER_NAME
|
||||
#endif // DOXYGEN
|
||||
|
||||
#ifdef STA_RTOS_EASY_CONFIG_WATCHDOG_TIMER_NAME
|
||||
# define STA_RTOS_WATCHDOG_TIMER_HANDLE STA_RTOS_MAKE_HANDLE_NAME(STA_RTOS_EASY_CONFIG_WATCHDOG_TIMER_NAME)
|
||||
# define STA_RTOS_WATCHDOG_TIMER_CALLBACK STA_RTOS_MAKE_CALLBACK_NAME(STA_RTOS_EASY_CONFIG_WATCHDOG_TIMER_NAME)
|
||||
#endif // STA_RTOS_EASY_CONFIG_WATCHDOG_TIMER_NAME
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
* @brief Common base name used for watchdog task handle and entry function names.
|
||||
*
|
||||
* @ingroup STA_RTOS_EasyConfig
|
||||
*/
|
||||
# define STA_RTOS_EASY_CONFIG_WATCHDOG_NAME
|
||||
#endif // DOXYGEN
|
||||
|
||||
#ifdef STA_RTOS_EASY_CONFIG_WATCHDOG_NAME
|
||||
# define STA_RTOS_WATCHDOG_HANDLE STA_RTOS_MAKE_HANDLE_NAME(STA_RTOS_EASY_CONFIG_WATCHDOG_NAME)
|
||||
# define STA_RTOS_WATCHDOG_ENTRY_FUNCTION STA_RTOS_MAKE_TASK_NAME(STA_RTOS_EASY_CONFIG_WATCHDOG_NAME)
|
||||
#endif // STA_RTOS_EASY_CONFIG_WATCHDOG_NAME
|
||||
|
||||
|
||||
#endif // STA_RTOS_EASY_CONFIG_HPP
|
||||
Reference in New Issue
Block a user