diff --git a/include/sta/os2/easy_config.hpp b/include/sta/os2/easy_config.hpp index 0e6ff52..931daf0 100644 --- a/include/sta/os2/easy_config.hpp +++ b/include/sta/os2/easy_config.hpp @@ -1,7 +1,7 @@ /** - * @brief Helper for easy system task setup in . + * @brief Helper for easy system task setup in ``. * - * Define STA_OS2_SYSTEM_TASKS_ENABLE before including this header + * Define **STA_OS2_SYSTEM_TASKS_ENABLE** before including this header * to enable all system tasks and required features. */ #ifndef STA_OS2_EASY_CONFIG_HPP diff --git a/include/sta/os2/mutex.hpp b/include/sta/os2/mutex.hpp index 028b88e..23e1d85 100644 --- a/include/sta/os2/mutex.hpp +++ b/include/sta/os2/mutex.hpp @@ -9,13 +9,13 @@ namespace sta { /** - * @brief Implementation of Mutex for CMSIS V2. + * @brief Implementation of `Mutex` interface using CMSIS RTOS2. */ class Os2Mutex : public Mutex { public: /** - * @param handle CMSIS V2 mutex + * @param handle CMSIS RTOS2 mutex */ Os2Mutex(osMutexId_t * handle); @@ -23,7 +23,7 @@ namespace sta void release() override; private: - osMutexId_t * handle_; /**< CMSIS V2 mutex */ + osMutexId_t * handle_; /**< CMSIS RTOS2 mutex */ }; } // namespace sta diff --git a/include/sta/os2/signal.hpp b/include/sta/os2/signal.hpp index ed0e815..319f623 100644 --- a/include/sta/os2/signal.hpp +++ b/include/sta/os2/signal.hpp @@ -8,9 +8,15 @@ namespace sta { + /** + * @brief Implementation of `Signal` interface using CMSIS RTOS2. + */ class Os2Signal : public Signal { public: + /** + * @param semaphore CMSIS RTOS2 semaphore + */ Os2Signal(osSemaphoreId_t * semaphore); void notify() override; @@ -19,7 +25,7 @@ namespace sta void wait() override; private: - osSemaphoreId_t * semaphore_; + osSemaphoreId_t * semaphore_; /**< CMSIS RTOS2 semaphore */ }; } // namespace sta diff --git a/include/sta/os2/startup.hpp b/include/sta/os2/startup.hpp index 4c66f11..94b11c4 100644 --- a/include/sta/os2/startup.hpp +++ b/include/sta/os2/startup.hpp @@ -1,10 +1,9 @@ /** * @brief Implementation of startup system task. * - * Define STA_OS2_STARTUP_ENABLE in to enable. - * * Configuration: - * STA_OS2_STARTUP_ENTRY_FUNCTION: Name of task entry function (default: startupTask) + * STA_OS2_STARTUP_ENABLE: Enable module + * STA_OS2_STARTUP_ENTRY_FUNCTION: Override name of startup task entry function (default: startupTask) */ #ifndef STA_OS2_STARTUP_HPP #define STA_OS2_STARTUP_HPP diff --git a/include/sta/os2/system_event.hpp b/include/sta/os2/system_event.hpp index 182f086..b36d501 100644 --- a/include/sta/os2/system_event.hpp +++ b/include/sta/os2/system_event.hpp @@ -1,10 +1,9 @@ /** * @brief Implementation of system events. * - * Define STA_OS2_SYSTEM_EVENT_ENABLE in to enable. - * - * Set STA_OS2_SYSTEM_EVENT_HANDLE to name of global handle variable. - * Defaults to `systemEventHandle`. + * Configuration: + * STA_OS2_SYSTEM_EVENT_ENABLE: Enable module + * STA_OS2_SYSTEM_EVENT_HANDLE: Override variable name of flag handle (default: systemEventHandle) */ #ifndef STA_OS2_SYSTEM_EVENT_HPP #define STA_OS2_SYSTEM_EVENT_HPP @@ -12,7 +11,7 @@ #include #ifdef STA_OS2_SYSTEM_EVENT_ENABLE -#include +#include // System event flags diff --git a/include/sta/os2/watchdog.hpp b/include/sta/os2/watchdog.hpp index 8ef5989..481696e 100644 --- a/include/sta/os2/watchdog.hpp +++ b/include/sta/os2/watchdog.hpp @@ -1,15 +1,13 @@ /** * @brief Implementation of watchdog system task. * - * Define STA_OS2_WATCHDOG_ENABLE in to enable. - * * Configuration: - * STA_OS2_WATCHDOG_TIMER_PERIOD: Period of heartbeat timer (default: 1000) - * STA_OS2_WATCHDOG_TIMER_HANDLE: Name of global timer handle variable (default: heartbeatHandle) - * STA_OS2_WATCHDOG_TIMER_CALLBACK: Name of timer callback function (default: heartbeatCallback) - * - * STA_OS2_WATCHDOG_HANDLE: Name of global task handle variable (default: watchdogHandle) - * STA_OS2_WATCHDOG_ENTRY_FUNCTION: Name of task entry function (default: watchdogTask) + * STA_OS2_WATCHDOG_ENABLE: Enable module + * STA_OS2_WATCHDOG_TIMER_PERIOD: Set period in ticks of heartbeat timer (default: 1000) + * STA_OS2_WATCHDOG_TIMER_HANDLE: Override variable name of heartbeat timer handle (default: heartbeatHandle) + * STA_OS2_WATCHDOG_TIMER_CALLBACK: Override name of heartbeat timer callback function (default: heartbeatCallback) + * STA_OS2_WATCHDOG_HANDLE: Override variable name of watchdog task handle (default: watchdogHandle) + * STA_OS2_WATCHDOG_ENTRY_FUNCTION: Override name of watchdog task entry function (default: watchdogTask) */ #ifndef STA_OS2_WATCHDOG_HPP #define STA_OS2_WATCHDOG_HPP @@ -17,7 +15,7 @@ #include #ifdef STA_OS2_WATCHDOG_ENABLE -#include +#include // Watchdog task flags diff --git a/src/os2/startup.cpp b/src/os2/startup.cpp index f5d8f13..aa1ee3f 100644 --- a/src/os2/startup.cpp +++ b/src/os2/startup.cpp @@ -36,7 +36,11 @@ extern "C" #ifdef STA_OS2_WATCHDOG_ENABLE // Start timers sta::startWatchdogTimer(); -#endif +#endif // STA_OS2_WATCHDOG_ENABLE + +#ifdef STA_HAL_DELAY_US_TIM + HAL_TIM_Base_Start(&STA_HAL_DELAY_US_TIM); +#endif // STA_HAL_DELAY_US_TIM // Wake tasks sta::signalStartupEvent();