This is an automated email from the ASF dual-hosted git repository.
archer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 890cf4764f drivers/timers/watchdog: support the configurations of
Auto-monitor reset timeout and Auto-monitor keep alive interval in milliseconds.
890cf4764f is described below
commit 890cf4764fcd2e64e2d2856a38a1a833c091ab43
Author: yaojiaqi <[email protected]>
AuthorDate: Wed Dec 11 11:33:21 2024 +0800
drivers/timers/watchdog: support the configurations of Auto-monitor reset
timeout and Auto-monitor keep alive interval in milliseconds.
In some areas with high security requirements such as vehicle control, in
order to meet functional safety requirements, the timeout and feeding interval
of the watchdog need to be configured in milliseconds
Signed-off-by: yaojiaqi <[email protected]>
---
drivers/timers/Kconfig | 4 ++--
drivers/timers/watchdog.c | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/timers/Kconfig b/drivers/timers/Kconfig
index cb7e6b7056..b76d50e127 100644
--- a/drivers/timers/Kconfig
+++ b/drivers/timers/Kconfig
@@ -480,8 +480,8 @@ config WATCHDOG_AUTOMONITOR_BY_IDLE
endchoice
config WATCHDOG_AUTOMONITOR_TIMEOUT
- int "Auto-monitor reset timeout(second)"
- default 60
+ int "Auto-monitor reset timeout(millisecond)"
+ default 60000
if !WATCHDOG_AUTOMONITOR_BY_CAPTURE && !WATCHDOG_AUTOMONITOR_BY_IDLE
diff --git a/drivers/timers/watchdog.c b/drivers/timers/watchdog.c
index 5079b03082..ca4cc9aa51 100644
--- a/drivers/timers/watchdog.c
+++ b/drivers/timers/watchdog.c
@@ -53,8 +53,8 @@
****************************************************************************/
#ifdef CONFIG_WATCHDOG_AUTOMONITOR
-# define WATCHDOG_AUTOMONITOR_TIMEOUT_MSEC \
- (CONFIG_WATCHDOG_AUTOMONITOR_TIMEOUT * MSEC_PER_SEC)
+# define WATCHDOG_AUTOMONITOR_TIMEOUT \
+ (CONFIG_WATCHDOG_AUTOMONITOR_TIMEOUT)
# if !defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_CAPTURE) && \
!defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_IDLE)
# if CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL == 0
@@ -65,9 +65,9 @@
CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL
# endif
# define WATCHDOG_AUTOMONITOR_PING_INTERVAL_MSEC \
- (WATCHDOG_AUTOMONITOR_PING_INTERVAL * MSEC_PER_SEC)
+ (WATCHDOG_AUTOMONITOR_PING_INTERVAL)
# define WATCHDOG_AUTOMONITOR_PING_INTERVAL_TICK \
- SEC2TICK(WATCHDOG_AUTOMONITOR_PING_INTERVAL)
+ MSEC2TICK(WATCHDOG_AUTOMONITOR_PING_INTERVAL)
# endif
#endif
@@ -276,7 +276,7 @@ watchdog_automonitor_start(FAR struct watchdog_upperhalf_s
*upper)
upper->monitor = true;
if (lower->ops->settimeout)
{
- lower->ops->settimeout(lower, WATCHDOG_AUTOMONITOR_TIMEOUT_MSEC);
+ lower->ops->settimeout(lower, WATCHDOG_AUTOMONITOR_TIMEOUT);
}
lower->ops->start(lower);