You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/09/20 20:04:46 UTC

[incubator-nuttx] 04/05: watchdog: Change WATCHDOG_AUTOMONITOR_PING_INTERVAL default to zero

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 665e05ec48b3e16bd7fe53c700bf6cb8dacd8318
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Sep 18 20:38:32 2022 +0800

    watchdog: Change WATCHDOG_AUTOMONITOR_PING_INTERVAL default to zero
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/timers/Kconfig    | 11 +++++------
 drivers/timers/watchdog.c |  3 +--
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/timers/Kconfig b/drivers/timers/Kconfig
index 877827baf8..8fa06cb4b7 100644
--- a/drivers/timers/Kconfig
+++ b/drivers/timers/Kconfig
@@ -400,13 +400,12 @@ if !WATCHDOG_AUTOMONITOR_BY_CAPTURE && !WATCHDOG_AUTOMONITOR_BY_IDLE
 
 config WATCHDOG_AUTOMONITOR_PING_INTERVAL
 	int "Auto-monitor keep a live interval"
-	default WATCHDOG_AUTOMONITOR_TIMEOUT
-	range 1 WATCHDOG_AUTOMONITOR_TIMEOUT
+	range 0 WATCHDOG_AUTOMONITOR_TIMEOUT
+	default 0
 	---help---
-		If the interval is same as WATCHDOG_AUTOMONITOR_TIMEOUT
-		the default value will change to (WATCHDOG_AUTOMONITOR_TIMEOUT / 2).
-		This interval will only be used by auto-monitor by Worker callback
-		or by Timer callback.
+		If the interval is 0, it will change to (WATCHDOG_AUTOMONITOR_TIMEOUT / 2).
+		This interval will only be used by auto-monitor in oneshot, timer, wdog or
+		worker case.
 
 endif # !WATCHDOG_AUTOMONITOR_BY_CAPTURE && !WATCHDOG_AUTOMONITOR_BY_IDLE
 
diff --git a/drivers/timers/watchdog.c b/drivers/timers/watchdog.c
index d8e69d172f..7d03da9896 100644
--- a/drivers/timers/watchdog.c
+++ b/drivers/timers/watchdog.c
@@ -53,8 +53,7 @@
      (CONFIG_WATCHDOG_AUTOMONITOR_TIMEOUT * MSEC_PER_SEC)
 #  if !defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_CAPTURE) && \
       !defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_IDLE)
-#    if CONFIG_WATCHDOG_AUTOMONITOR_TIMEOUT == \
-        CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL
+#    if CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL == 0
 #      define WATCHDOG_AUTOMONITOR_PING_INTERVAL \
          (CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL / 2)
 #    else