xiaoxiang781216 commented on a change in pull request #1545: URL: https://github.com/apache/incubator-nuttx/pull/1545#discussion_r468702913
########## File path: Documentation/NuttxPortingGuide.html ########## @@ -2824,100 +2824,13 @@ <h3><a name="Watchdogs">4.4.5 Watchdog Timer Interfaces</a></h3> or <code>kill()</code> to communicate with NuttX tasks. </p> <ul> - <li><a href="#wdcreate">4.4.5.1 wd_create/wd_static</a></li> - <li><a href="#wddelete">4.4.5.2 wd_delete</a></li> <li><a href="#wdstart">4.4.5.3 wd_start</a></li> <li><a href="#wdcancel">4.4.5.4 wd_cancel</a></li> <li><a href="#wdgettime">4.4.5.5 wd_gettime</a></li> <li><a href="#wdcallback">4.4.5.6 Watchdog Timer Callback</a></li> </ul> -<h4><a name="wdcreate">4.4.5.1 wd_create/wd_static</a></h4> - -<p> -<b>Function Prototype:</b> -<pre> - #include <nuttx/wdog.h> - WDOG_ID wd_create(void); - void wd_static(FAR struct wdog_s *wdog); -</pre> - -<p> -<b>Description:</b> The <code>wd_create()</code> function will create a timer by allocating the appropriate resources for the watchdog. The <code>wd_create()</code> function returns a pointer to a fully initialized, dynamically allocated <code>struct wdog_s</code> instance (which is <code>typedef</code>'ed as <code>WDOG_ID</code>); -</p> -<p> -<code>wd_static()</code> performs the equivalent initialization of a statically allocated <code>struct wdog_s</code> instance. No allocation is performed in this case. The initializer definition, <code>WDOG_INITIALIZER</code> is also available for initialization of static instances of <code>struct wdog_s</code>. NOTE: <code>wd_static()</code> is also implemented as a macro definition. -</p> -<p> -<b>Input Parameters:</b> None. -<p> -<b>Returned Value:</b> -<ul> -<li>Pointer to watchdog that may be used as a handle in subsequent NuttX calls (i.e., the watchdog ID), or NULL if insufficient resources are available to create the watchdogs. -</ul> - -<p> -<b>Assumptions/Limitations:</b> -<p> -<b> POSIX Compatibility:</b> This is a NON-POSIX interface. -VxWorks provides the following comparable interface: -<pre> - WDOG_ID wdCreate (void); -</pre> - -<p> -Differences from the VxWorks interface include: -<ul> -<li>The number of available watchdogs is fixed (configured at -initialization time). -</ul> - -<h4><a name="wddelete">4.4.5.2 wd_delete</a></h4> - -<p> -<b>Function Prototype:</b> -<pre> - #include <nuttx/wdog.h> - int wd_delete(WDOG_ID wdog); -</pre> - -<p> -<b>Description:</b> The wd_delete function will deallocate a watchdog timer previously allocated via <code>wd_create()</code>. The watchdog timer will be removed from the timer queue if has been started. -<p> -<p> -This function need not be called for statically allocated timers (but it is not harmful to do so). -</p> -<b>Input Parameters:</b> -<ul> -<li><code>wdog</code>. The watchdog ID to delete. This is actually a -pointer to a watchdog structure. -</ul> - -<p> -<b>Returned Value:</b> -<ul> -<li>Zero (<code>OK</code>) is returned on success; a negated <code>errno</code> value is return to indicate the nature of any failure. -</ul> - -<p> -<b>Assumptions/Limitations:</b> It is the responsibility of the -caller to assure that the watchdog is inactive before deleting -it. -<p> -<b>POSIX Compatibility:</b> This is a NON-POSIX interface. -VxWorks provides the following comparable interface: -<pre> - STATUS wdDelete (WDOG_ID wdog); -</pre> - -<p> -Differences from the VxWorks interface include: -<ul> -<li>Does not make any checks to see if the watchdog is being used -before deallocating it (i.e., never returns ERROR). -</ul> - <h4><a name="wdstart">4.4.5.3 wd_start</a></h4> Review comment: Will fix in the next update. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org