mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
Documentation: Add wd_restart_next() API description
Add documentation for the newly introduced wd_restart_next() API,
describing its purpose and usage.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
committed by
Xiang Xiao
parent
07e05b8591
commit
61c4c54bd3
@@ -491,6 +491,7 @@ with NuttX tasks.
|
||||
|
||||
- :c:func:`wd_start`
|
||||
- :c:func:`wd_restart`
|
||||
- :c:func:`wd_restart_next`
|
||||
- :c:func:`wd_cancel`
|
||||
- :c:func:`wd_gettime`
|
||||
- Watchdog Timer Callback
|
||||
@@ -555,6 +556,25 @@ with NuttX tasks.
|
||||
:return: Zero (``OK``) is returned on success; a negated ``errno`` value
|
||||
is return to indicate the nature of any failure.
|
||||
|
||||
.. c:function:: int wd_restart_next(FAR struct wdog_s *wdog, clock_t delay)
|
||||
|
||||
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.
|
||||
|
||||
:param wdog: Pointer to the watchdog timer to restart
|
||||
:param delay: Delay count in clock ticks
|
||||
|
||||
**NOTE**: The parameter must be of type ``wdparm_t``.
|
||||
|
||||
:return: Zero (``OK``) is returned on success; a negated ``errno`` value
|
||||
is return to indicate the nature of any failure.
|
||||
|
||||
.. c:function:: int wd_cancel(FAR struct wdog_s *wdog)
|
||||
|
||||
This function cancels a currently running
|
||||
|
||||
Reference in New Issue
Block a user