forked from EmbeddedTeam/app_photomagnetic
28 lines
553 B
C++
28 lines
553 B
C++
#ifndef __ZPP_WATCHDOG_HPP
|
|
#define __ZPP_WATCHDOG_HPP
|
|
#include <zephyr/drivers/watchdog.h>
|
|
#include <zpp/assert.hpp>
|
|
namespace app {
|
|
class WatchDogConfig {
|
|
public:
|
|
#if 0
|
|
WatchDogConfig() {
|
|
if (!device_is_ready(m_wtd)) {
|
|
__ASSERT_NO_MSG(0);
|
|
}
|
|
wdt_install_timeout(m_wtd, &wdt_timeout_cfg);
|
|
|
|
if (auto err = wdt_setup(m_wtd, WDT_OPT_PAUSE_HALTED_BY_DBG); err < 0) {
|
|
__ASSERT_NO_MSG(0);
|
|
}
|
|
wdt_timeout_cfg cfg;
|
|
}
|
|
|
|
private:
|
|
const device *m_wtd{DEVICE_DT_GET(DT_ALIAS(watchdog0))};
|
|
#endif
|
|
};
|
|
|
|
} // namespace app
|
|
|
|
#endif |