rtos2-utils/include/sta/os2/watchdog.hpp
2022-04-09 21:15:27 +02:00

45 lines
1.1 KiB
C++

/**
* @brief Implementation of watchdog system task.
*
* Define STA_OS2_WATCHDOG_ENABLE in <sta/config.hpp> 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)
*/
#ifndef STA_OS2_WATCHDOG_HPP
#define STA_OS2_WATCHDOG_HPP
#include <sta/config.hpp>
#ifdef STA_OS2_WATCHDOG_ENABLE
#include <stdint.h>
// Watchdog task flags
//
#define STA_WATCHDOG_FLAG_HEARTBEAT 0x00001000U
namespace sta
{
/**
* @brief Start heartbeat timer for watchdog.
*/
void startWatchdogTimer();
/**
* @brief Send notification to watchdog task.
*/
void notifyWatchdog(uint32_t flags);
} // namespace sta
#endif // STA_OS2_WATCHDOG_ENABLE
#endif // STA_OS2_WATCHDOG_HPP