wangchdo commented on code in PR #17295:
URL: https://github.com/apache/nuttx/pull/17295#discussion_r2508669212
##########
sched/wdog/wd_start.c:
##########
@@ -400,6 +400,43 @@ int wd_start(FAR struct wdog_s *wdog, clock_t delay,
wdentry, arg);
}
+/****************************************************************************
+ * Name: wd_restart
+ *
+ * Description:
+ * This function restarts (reloads) an already-started watchdog timer
+ * with a new delay time, without modifying its existing handler function
+ * or argument.
+ *
+ * It behaves similarly to wd_start(), but is typically used when the
+ * watchdog has already been started and needs to be rearmed before it
+ * expires. The same watchdog function (wdog->func) will be called from
+ * the interrupt level after the specified number of ticks has elapsed.
+ *
+ * Watchdog timers may be started or reloaded from the interrupt level.
+ * Watchdog timers execute in the address environment that was in effect
+ * when wd_restart() is called.
+ * Watchdog timers execute only once.
+ *
+ * Input Parameters:
+ * wdog - Watchdog ID
+ *
+ * Returned Value:
+ * Zero (OK) is returned on success; a negated errno value is returned to
+ * indicate the nature of any failure.
+ *
+ * Assumptions:
+ * The watchdog routine runs in the context of the timer interrupt handler
+ * and is subject to all ISR restrictions.
+ *
+ ****************************************************************************/
+
+int wd_restart(FAR struct wdog_s *wdog)
+{
+ return wd_start_abstick(wdog, clock_restartdelay2abstick(wdog->delay),
Review Comment:
Done
##########
sched/wdog/wd_start.c:
##########
@@ -400,6 +400,43 @@ int wd_start(FAR struct wdog_s *wdog, clock_t delay,
wdentry, arg);
}
+/****************************************************************************
+ * Name: wd_restart
+ *
+ * Description:
+ * This function restarts (reloads) an already-started watchdog timer
+ * with a new delay time, without modifying its existing handler function
+ * or argument.
+ *
+ * It behaves similarly to wd_start(), but is typically used when the
+ * watchdog has already been started and needs to be rearmed before it
+ * expires. The same watchdog function (wdog->func) will be called from
+ * the interrupt level after the specified number of ticks has elapsed.
+ *
+ * Watchdog timers may be started or reloaded from the interrupt level.
+ * Watchdog timers execute in the address environment that was in effect
+ * when wd_restart() is called.
+ * Watchdog timers execute only once.
+ *
+ * Input Parameters:
+ * wdog - Watchdog ID
+ *
+ * Returned Value:
+ * Zero (OK) is returned on success; a negated errno value is returned to
+ * indicate the nature of any failure.
+ *
+ * Assumptions:
+ * The watchdog routine runs in the context of the timer interrupt handler
+ * and is subject to all ISR restrictions.
+ *
+ ****************************************************************************/
+
+int wd_restart(FAR struct wdog_s *wdog)
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]