Skip to content

Commit

Permalink
drivers/timers/watchdog: support the configurations of Auto-monitor r…
Browse files Browse the repository at this point in the history
…eset 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]>
  • Loading branch information
Jiaqi-YP7 authored and anchao committed Dec 12, 2024
1 parent cafdcb1 commit 890cf47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions drivers/timers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions drivers/timers/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 890cf47

Please sign in to comment.