mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-07 18:10:34 +08:00
px4io: add watchdog
- F1 iwdg:Support optional configuable init Co-authored-by: David Sidrane <David.Sidrane@NscDg.com>
This commit is contained in:
@@ -47,6 +47,7 @@ set_property(GLOBAL APPEND PROPERTY PX4_MODULE_LIBRARIES px4iofirmware)
|
||||
target_link_libraries(px4iofirmware
|
||||
PUBLIC
|
||||
arch_io_pins
|
||||
arch_watchdog_iwdg
|
||||
nuttx_apps
|
||||
nuttx_arch
|
||||
nuttx_c
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
|
||||
#include <drivers/drv_pwm_output.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <drivers/drv_watchdog.h>
|
||||
|
||||
#if defined(PX4IO_PERF)
|
||||
# include <lib/perf/perf_counter.h>
|
||||
@@ -398,7 +399,11 @@ user_start(int argc, char *argv[])
|
||||
uint64_t last_heartbeat_time = 0;
|
||||
uint64_t last_loop_time = 0;
|
||||
|
||||
watchdog_init();
|
||||
|
||||
for (;;) {
|
||||
watchdog_pet();
|
||||
|
||||
dt = (hrt_absolute_time() - last_loop_time) / 1000000.0f;
|
||||
last_loop_time = hrt_absolute_time();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user