mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
sched/wdog: Remove wd_restart API.
According to the test results, the restart interface offers no performance improvement and requires additional state to encode the non-pending state. This commit removed the wd_restart API to simplify the wdog module. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
committed by
Xiang Xiao
parent
fac76746ea
commit
df74d0c5b2
@@ -338,73 +338,6 @@ int wd_start_next(FAR struct wdog_s *wdog, clock_t delay,
|
||||
return wd_start_abstick(wdog, wdog->expired + delay, wdentry, arg);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: wd_restart_next
|
||||
*
|
||||
* Description:
|
||||
* This function restarts the specified watchdog timer using a new delay
|
||||
* value, but schedules the next expiration based on the previous
|
||||
* expiration time (wdog->expired + delay). This allows the watchdog to
|
||||
* maintain a consistent periodic interval even if there is some delay in
|
||||
* handling the expiration callback.
|
||||
*
|
||||
* It can be used when the user wants to restart a watchdog for a different
|
||||
* purpose or continue periodic timing based on the previous timeout point.
|
||||
*
|
||||
* Input Parameters:
|
||||
* wdog - Pointer to the watchdog timer to restart
|
||||
* delay - Delay time in system ticks to add after the previous expiration
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; a negated errno value is returned
|
||||
* to indicate the nature of any failure.
|
||||
*
|
||||
* Assumptions:
|
||||
* - The watchdog must already have expired or been started before calling
|
||||
* this function so that wdog->expired is valid.
|
||||
* - The watchdog routine runs in the context of the timer interrupt
|
||||
* handler and is subject to all ISR restrictions.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline_function
|
||||
int wd_restart_next(FAR struct wdog_s *wdog, clock_t delay)
|
||||
{
|
||||
return wd_start_next(wdog, delay, wdog->func, wdog->arg);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: wd_restart
|
||||
*
|
||||
* Description:
|
||||
* This function restarts the specified watchdog timer using the same
|
||||
* function and argument that were specified in the previous wd_start()
|
||||
* call, but with a new delay value. It can be used when the user wants
|
||||
* to restart the same watchdog with a different timeout value, or to
|
||||
* refresh (feed) an existing watchdog before it expires.
|
||||
*
|
||||
* Input Parameters:
|
||||
* wdog - Pointer to the watchdog timer to restart.
|
||||
* delay - New delay time in system ticks before the watchdog expires.
|
||||
*
|
||||
* 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.
|
||||
* - The watchdog must have been previously started so that the stored
|
||||
* function (wdog->func) and argument (wdog->arg) are valid.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline_function
|
||||
int wd_restart(FAR struct wdog_s *wdog, clock_t delay)
|
||||
{
|
||||
return wd_start(wdog, delay, wdog->func, wdog->arg);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: wd_cancel
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user