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 <yaojiaqi@lixiang.com>
This commit is contained in:
yaojiaqi 2024-12-11 11:33:21 +08:00 committed by archer
parent cafdcb1eb0
commit 890cf4764f
2 changed files with 7 additions and 7 deletions

View file

@ -480,8 +480,8 @@ config WATCHDOG_AUTOMONITOR_BY_IDLE
endchoice endchoice
config WATCHDOG_AUTOMONITOR_TIMEOUT config WATCHDOG_AUTOMONITOR_TIMEOUT
int "Auto-monitor reset timeout(second)" int "Auto-monitor reset timeout(millisecond)"
default 60 default 60000
if !WATCHDOG_AUTOMONITOR_BY_CAPTURE && !WATCHDOG_AUTOMONITOR_BY_IDLE if !WATCHDOG_AUTOMONITOR_BY_CAPTURE && !WATCHDOG_AUTOMONITOR_BY_IDLE

View file

@ -53,8 +53,8 @@
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_WATCHDOG_AUTOMONITOR #ifdef CONFIG_WATCHDOG_AUTOMONITOR
# define WATCHDOG_AUTOMONITOR_TIMEOUT_MSEC \ # define WATCHDOG_AUTOMONITOR_TIMEOUT \
(CONFIG_WATCHDOG_AUTOMONITOR_TIMEOUT * MSEC_PER_SEC) (CONFIG_WATCHDOG_AUTOMONITOR_TIMEOUT)
# if !defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_CAPTURE) && \ # if !defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_CAPTURE) && \
!defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_IDLE) !defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_IDLE)
# if CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL == 0 # if CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL == 0
@ -65,9 +65,9 @@
CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL
# endif # endif
# define WATCHDOG_AUTOMONITOR_PING_INTERVAL_MSEC \ # define WATCHDOG_AUTOMONITOR_PING_INTERVAL_MSEC \
(WATCHDOG_AUTOMONITOR_PING_INTERVAL * MSEC_PER_SEC) (WATCHDOG_AUTOMONITOR_PING_INTERVAL)
# define WATCHDOG_AUTOMONITOR_PING_INTERVAL_TICK \ # define WATCHDOG_AUTOMONITOR_PING_INTERVAL_TICK \
SEC2TICK(WATCHDOG_AUTOMONITOR_PING_INTERVAL) MSEC2TICK(WATCHDOG_AUTOMONITOR_PING_INTERVAL)
# endif # endif
#endif #endif
@ -276,7 +276,7 @@ watchdog_automonitor_start(FAR struct watchdog_upperhalf_s *upper)
upper->monitor = true; upper->monitor = true;
if (lower->ops->settimeout) if (lower->ops->settimeout)
{ {
lower->ops->settimeout(lower, WATCHDOG_AUTOMONITOR_TIMEOUT_MSEC); lower->ops->settimeout(lower, WATCHDOG_AUTOMONITOR_TIMEOUT);
} }
lower->ops->start(lower); lower->ops->start(lower);