rtos2-utils/include/sta/os2/easy_config.hpp
2022-04-10 16:31:20 +02:00

37 lines
1.2 KiB
C++

/**
* @brief Helper for easy system task setup in <sta/config.hpp>.
*
* Define STA_OS2_SYSTEM_TASKS_ENABLE before including this header
* to enable all system tasks and required features.
*/
#ifndef STA_OS2_EASY_CONFIG_HPP
#define STA_OS2_EASY_CONFIG_HPP
#ifndef STA_CONFIG_HPP
#warning "Intended for use in <sta/config.hpp>"
#endif // STA_CONFIG_HPP
#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
// Use common base name for watchdog timer handle and callback
#ifdef STA_OS2_WATCHDOG_TIMER_NAME
# define STA_OS2_WATCHDOG_TIMER_HANDLE STA_OS2_WATCHDOG_TIMER_NAME ## Handle
# define STA_OS2_WATCHDOG_TIMER_CALLBACK STA_OS2_WATCHDOG_TIMER_NAME ## Callback
#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_WATCHDOG_NAME ## Handle
# define STA_OS2_WATCHDOG_ENTRY_FUNCTION STA_OS2_WATCHDOG_NAME ## Task
#endif // STA_OS2_WATCHDOG_NAME
#endif // STA_OS2_EASY_CONFIG_HPP