nico@207: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> nico@207: <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> nico@215: <title>CanFestival: src/timer.c File Reference</title> nico@207: <link href="doxygen.css" rel="stylesheet" type="text/css"> nico@207: <link href="tabs.css" rel="stylesheet" type="text/css"> nico@207: </head><body> nico@207: <!-- Generated by Doxygen 1.5.1 --> nico@207: <div class="tabs"> nico@207: <ul> nico@207: <li><a href="main.html"><span>Main Page</span></a></li> nico@215: <li><a href="annotated.html"><span>Data Structures</span></a></li> nico@207: <li id="current"><a href="files.html"><span>Files</span></a></li> nico@215: <li><a href="dirs.html"><span>Directories</span></a></li> nico@207: </ul></div> nico@207: <div class="tabs"> nico@207: <ul> nico@207: <li><a href="files.html"><span>File List</span></a></li> nico@207: <li><a href="globals.html"><span>Globals</span></a></li> nico@207: </ul></div> nico@215: <div class="nav"> etisserant@240: <a class="el" href="dir_0aa10e4f705947227e11e7ccb081fbe4.html">src</a></div> nico@215: <h1>timer.c File Reference</h1><code>#include <<a class="el" href="win32_2applicfg_8h-source.html">applicfg.h</a>></code><br> nico@215: <code>#include "<a class="el" href="timer_8h-source.html">timer.h</a>"</code><br> nico@215: nico@215: <p> nico@215: Include dependency graph for timer.c:<p><center><img src="timer_8c__incl.png" border="0" usemap="#src/timer.c_map" alt=""></center> nico@215: <map name="src/timer.c_map"> etisserant@240: <area href="win32_2applicfg_8h.html" shape="rect" coords="608,296,683,323" alt=""> etisserant@240: <area href="timer_8h.html" shape="rect" coords="132,296,191,323" alt=""> etisserant@240: <area href="win32_2timerscfg_8h.html" shape="rect" coords="241,587,321,613" alt=""> etisserant@240: <area href="data_8h.html" shape="rect" coords="255,296,308,323" alt=""> etisserant@240: <area href="def_8h.html" shape="rect" coords="511,549,559,576" alt=""> etisserant@240: <area href="can_8h.html" shape="rect" coords="511,448,559,475" alt=""> etisserant@240: <area href="objdictdef_8h.html" shape="rect" coords="373,397,459,424" alt=""> etisserant@240: <area href="objacces_8h.html" shape="rect" coords="377,93,455,120" alt=""> etisserant@240: <area href="sdo_8h.html" shape="rect" coords="392,600,440,627" alt=""> etisserant@240: <area href="pdo_8h.html" shape="rect" coords="391,499,441,525" alt=""> etisserant@240: <area href="states_8h.html" shape="rect" coords="385,245,447,272" alt=""> etisserant@240: <area href="lifegrd_8h.html" shape="rect" coords="383,296,449,323" alt=""> etisserant@240: <area href="sync_8h.html" shape="rect" coords="388,144,444,171" alt=""> etisserant@240: <area href="nmtMaster_8h.html" shape="rect" coords="372,195,460,221" alt=""> etisserant@240: <area href="config_8h.html" shape="rect" coords="613,549,677,576" alt=""> nico@215: </map> nico@210: nico@210: <p> nico@207: <a href="timer_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> nico@207: <tr><td></td></tr> nico@207: <tr><td colspan="2"><br><h2>Defines</h2></td></tr> etisserant@240: <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#d2d95744d6e355721e7bbc2c07d934a4">min_val</a>(a, b) ((a<b)?a:b)</td></tr> nico@207: nico@207: <tr><td colspan="2"><br><h2>Functions</h2></td></tr> etisserant@240: <tr><td class="memItemLeft" nowrap align="right" valign="top">TIMER_HANDLE </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#956b22f24089db4c367f40199f838a20">SetAlarm</a> (<a class="el" href="structstruct__CO__Data.html">CO_Data</a> *d, UNS32 id, <a class="el" href="timer_8h.html#c8436e7543fa1329b00e570246071313">TimerCallback_t</a> callback, TIMEVAL value, TIMEVAL period)</td></tr> etisserant@240: etisserant@240: <tr><td class="memItemLeft" nowrap align="right" valign="top">TIMER_HANDLE </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#12fe6467e1df03cc40dd6f76123c99f6">DelAlarm</a> (TIMER_HANDLE handle)</td></tr> etisserant@240: etisserant@240: <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#7a5a515821c2e4fb2f66bac72389da00">TimeDispatch</a> ()</td></tr> nico@207: nico@207: <tr><td colspan="2"><br><h2>Variables</h2></td></tr> etisserant@240: <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structstruct__s__timer__entry.html">s_timer_entry</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#adb4c8d5876b377463d33bdeda56b575">timers</a> [MAX_NB_TIMER] = {{TIMER_FREE, NULL, NULL, 0, 0, 0},}</td></tr> etisserant@240: etisserant@240: <tr><td class="memItemLeft" nowrap align="right" valign="top">TIMEVAL </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#242986a224c5a02d6341dd5bfdf71008">total_sleep_time</a> = TIMEVAL_MAX</td></tr> etisserant@240: etisserant@240: <tr><td class="memItemLeft" nowrap align="right" valign="top">TIMER_HANDLE </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#4afd63ff2f23fe7cd60f0d82e78c4426">last_timer_raw</a> = -1</td></tr> nico@207: nico@207: </table> nico@210: <hr><a name="_details"></a><h2>Detailed Description</h2> nico@210: <dl class="author" compact><dt><b>Author:</b></dt><dd>Edouard TISSERANT and Francis DUPIN </dd></dl> nico@210: <dl class="date" compact><dt><b>Date:</b></dt><dd>Tue Jun 5 09:32:32 2007 </dd></dl> nico@210: nico@210: <p> nico@210: Definition in file <a class="el" href="timer_8c-source.html">timer.c</a>.<hr><h2>Define Documentation</h2> etisserant@240: <a class="anchor" name="d2d95744d6e355721e7bbc2c07d934a4"></a><!-- doxytag: member="timer.c::min_val" ref="d2d95744d6e355721e7bbc2c07d934a4" args="(a, b)" --> nico@207: <div class="memitem"> nico@207: <div class="memproto"> nico@207: <table class="memname"> nico@207: <tr> nico@207: <td class="memname">#define min_val </td> nico@207: <td>(</td> nico@207: <td class="paramtype">a, <tr> nico@207: <td class="paramkey"></td> nico@207: <td></td> nico@207: <td class="paramtype">b </td> nico@207: <td class="paramname"> </td> nico@207: <td> ) </td> nico@207: <td width="100%"> ((a<b)?a:b)</td> nico@207: </tr> nico@207: </table> nico@207: </div> nico@207: <div class="memdoc"> nico@207: nico@207: <p> nico@207: nico@207: <p> nico@210: Definition at line <a class="el" href="timer_8c-source.html#l00044">44</a> of file <a class="el" href="timer_8c-source.html">timer.c</a>. nico@210: <p> nico@210: Referenced by <a class="el" href="timer_8c-source.html#l00131">TimeDispatch()</a>. nico@207: </div> nico@207: </div><p> nico@207: <hr><h2>Function Documentation</h2> etisserant@240: <a class="anchor" name="12fe6467e1df03cc40dd6f76123c99f6"></a><!-- doxytag: member="timer.c::DelAlarm" ref="12fe6467e1df03cc40dd6f76123c99f6" args="(TIMER_HANDLE handle)" --> nico@207: <div class="memitem"> nico@207: <div class="memproto"> nico@207: <table class="memname"> nico@207: <tr> nico@207: <td class="memname">TIMER_HANDLE DelAlarm </td> nico@207: <td>(</td> nico@207: <td class="paramtype">TIMER_HANDLE </td> nico@207: <td class="paramname"> <em>handle</em> </td> nico@207: <td> ) </td> nico@207: <td width="100%"></td> nico@207: </tr> nico@207: </table> nico@207: </div> nico@207: <div class="memdoc"> nico@207: nico@207: <p> nico@210: ----- Use this to remove an alarm ----<p> nico@210: <dl compact><dt><b>Parameters:</b></dt><dd> nico@210: <table border="0" cellspacing="2" cellpadding="0"> nico@210: <tr><td valign="top"></td><td valign="top"><em>handle</em> </td><td></td></tr> nico@210: </table> nico@210: </dl> nico@210: <dl class="return" compact><dt><b>Returns:</b></dt><dd></dd></dl> nico@210: nico@210: <p> nico@210: Definition at line <a class="el" href="timer_8c-source.html#l00112">112</a> of file <a class="el" href="timer_8c-source.html">timer.c</a>. nico@210: <p> nico@215: References <a class="el" href="timer_8c-source.html#l00042">last_timer_raw</a>, <a class="el" href="hcs12_2applicfg_8h-source.html#l00190">MSG_WAR</a>, <a class="el" href="timer_8h-source.html#l00044">struct_s_timer_entry::state</a>, and <a class="el" href="timer_8c-source.html#l00039">timers</a>. nico@210: <p> etisserant@240: Referenced by <a class="el" href="pdo_8c-source.html#l00442">_sendPDOevent()</a>, <a class="el" href="lifegrd_8c-source.html#l00236">heartbeatStop()</a>, <a class="el" href="pdo_8c-source.html#l00632">PDOStop()</a>, <a class="el" href="lifegrd_8c-source.html#l00081">proceedNODE_GUARD()</a>, <a class="el" href="pdo_8c-source.html#l00141">proceedPDO()</a>, <a class="el" href="lifegrd_8c-source.html#l00161">ProducerHearbeatAlarm()</a>, <a class="el" href="sync_8c-source.html#l00105">stopSYNC()</a>, and <a class="el" href="pdo_8c-source.html#l00573">TPDO_Communication_Parameter_Callback()</a>. etisserant@240: </div> etisserant@240: </div><p> etisserant@240: <a class="anchor" name="956b22f24089db4c367f40199f838a20"></a><!-- doxytag: member="timer.c::SetAlarm" ref="956b22f24089db4c367f40199f838a20" args="(CO_Data *d, UNS32 id, TimerCallback_t callback, TIMEVAL value, TIMEVAL period)" --> nico@207: <div class="memitem"> nico@207: <div class="memproto"> nico@207: <table class="memname"> nico@207: <tr> nico@207: <td class="memname">TIMER_HANDLE SetAlarm </td> nico@207: <td>(</td> nico@215: <td class="paramtype"><a class="el" href="structstruct__CO__Data.html">CO_Data</a> * </td> nico@207: <td class="paramname"> <em>d</em>, </td> nico@207: </tr> nico@207: <tr> nico@207: <td class="paramkey"></td> nico@207: <td></td> nico@207: <td class="paramtype">UNS32 </td> nico@207: <td class="paramname"> <em>id</em>, </td> nico@207: </tr> nico@207: <tr> nico@207: <td class="paramkey"></td> nico@207: <td></td> etisserant@240: <td class="paramtype"><a class="el" href="timer_8h.html#c8436e7543fa1329b00e570246071313">TimerCallback_t</a> </td> nico@207: <td class="paramname"> <em>callback</em>, </td> nico@207: </tr> nico@207: <tr> nico@207: <td class="paramkey"></td> nico@207: <td></td> nico@207: <td class="paramtype">TIMEVAL </td> nico@207: <td class="paramname"> <em>value</em>, </td> nico@207: </tr> nico@207: <tr> nico@207: <td class="paramkey"></td> nico@207: <td></td> nico@207: <td class="paramtype">TIMEVAL </td> nico@207: <td class="paramname"> <em>period</em></td><td> </td> nico@207: </tr> nico@207: <tr> nico@207: <td></td> nico@207: <td>)</td> nico@207: <td></td><td></td><td width="100%"></td> nico@207: </tr> nico@207: </table> nico@207: </div> nico@207: <div class="memdoc"> nico@207: nico@207: <p> nico@210: ------- Use this to declare a new alarm ------<p> nico@210: <dl compact><dt><b>Parameters:</b></dt><dd> nico@210: <table border="0" cellspacing="2" cellpadding="0"> nico@210: <tr><td valign="top"></td><td valign="top"><em>d</em> </td><td></td></tr> nico@210: <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td></td></tr> nico@210: <tr><td valign="top"></td><td valign="top"><em>callback</em> </td><td></td></tr> nico@210: <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td></td></tr> nico@210: <tr><td valign="top"></td><td valign="top"><em>period</em> </td><td></td></tr> nico@210: </table> nico@210: </dl> nico@210: <dl class="return" compact><dt><b>Returns:</b></dt><dd></dd></dl> nico@210: nico@210: <p> nico@210: Definition at line <a class="el" href="timer_8c-source.html#l00057">57</a> of file <a class="el" href="timer_8c-source.html">timer.c</a>. nico@210: <p> nico@215: References <a class="el" href="timer_8h-source.html#l00045">struct_s_timer_entry::d</a>, <a class="el" href="timer_8c-source.html#l00042">last_timer_raw</a>, <a class="el" href="config_8h-source.html#l00032">MAX_NB_TIMER</a>, <a class="el" href="timer_8h-source.html#l00029">TIMER_HANDLE</a>, and <a class="el" href="timer_8c-source.html#l00039">timers</a>. nico@215: <p> etisserant@240: Referenced by <a class="el" href="pdo_8c-source.html#l00442">_sendPDOevent()</a>, <a class="el" href="lifegrd_8c-source.html#l00206">heartbeatInit()</a>, <a class="el" href="lifegrd_8c-source.html#l00081">proceedNODE_GUARD()</a>, <a class="el" href="sync_8c-source.html#l00080">startSYNC()</a>, and <a class="el" href="timers__unix_8c-source.html#l00062">StartTimerLoop()</a>. etisserant@240: </div> etisserant@240: </div><p> etisserant@240: <a class="anchor" name="7a5a515821c2e4fb2f66bac72389da00"></a><!-- doxytag: member="timer.c::TimeDispatch" ref="7a5a515821c2e4fb2f66bac72389da00" args="()" --> nico@207: <div class="memitem"> nico@207: <div class="memproto"> nico@207: <table class="memname"> nico@207: <tr> nico@207: <td class="memname">void TimeDispatch </td> nico@207: <td>(</td> nico@215: <td class="paramtype">void </td> nico@207: <td class="paramname"> </td> nico@207: <td> ) </td> nico@207: <td width="100%"></td> nico@207: </tr> nico@207: </table> nico@207: </div> nico@207: <div class="memdoc"> nico@207: nico@207: <p> nico@210: ------ TimeDispatch is called on each timer expiration ---- nico@210: <p> nico@210: Definition at line <a class="el" href="timer_8c-source.html#l00131">131</a> of file <a class="el" href="timer_8c-source.html">timer.c</a>. nico@210: <p> nico@215: References <a class="el" href="canOpenDriver_8c-source.html#l00066">getElapsedTime()</a>, <a class="el" href="timer_8c-source.html#l00042">last_timer_raw</a>, <a class="el" href="timer_8c-source.html#l00044">min_val</a>, <a class="el" href="timer_8h-source.html#l00029">TIMER_HANDLE</a>, <a class="el" href="timer_8c-source.html#l00039">timers</a>, <a class="el" href="hcs12_2applicfg_8h-source.html#l00150">TIMEVAL</a>, <a class="el" href="hcs12_2applicfg_8h-source.html#l00153">TIMEVAL_MAX</a>, and <a class="el" href="timer_8c-source.html#l00041">total_sleep_time</a>. nico@215: <p> nico@215: Referenced by <a class="el" href="timers__win32_8cpp-source.html#l00151">class_timers::timer_loop_thread_proc()</a>, <a class="el" href="timers__unix_8c-source.html#l00030">timer_notify()</a>, and <a class="el" href="timers__xeno_8c-source.html#l00045">timerloop_task_proc()</a>. nico@215: <p> etisserant@240: Here is the call graph for this function:<p><center><img src="timer_8c_7a5a515821c2e4fb2f66bac72389da00_cgraph.png" border="0" usemap="#timer_8c_7a5a515821c2e4fb2f66bac72389da00_cgraph_map" alt=""></center> etisserant@240: <map name="timer_8c_7a5a515821c2e4fb2f66bac72389da00_cgraph_map"> etisserant@240: <area href="canOpenDriver_8c.html#38b23a8ee3748bca3415967b90df1e15" shape="rect" coords="153,5,260,32" alt=""> nico@215: </map> nico@215: nico@207: </div> nico@207: </div><p> nico@207: <hr><h2>Variable Documentation</h2> etisserant@240: <a class="anchor" name="4afd63ff2f23fe7cd60f0d82e78c4426"></a><!-- doxytag: member="timer.c::last_timer_raw" ref="4afd63ff2f23fe7cd60f0d82e78c4426" args="" --> etisserant@240: <div class="memitem"> etisserant@240: <div class="memproto"> etisserant@240: <table class="memname"> etisserant@240: <tr> etisserant@240: <td class="memname">TIMER_HANDLE <a class="el" href="timer_8c.html#4afd63ff2f23fe7cd60f0d82e78c4426">last_timer_raw</a> = -1 </td> nico@207: </tr> nico@207: </table> nico@207: </div> nico@207: <div class="memdoc"> nico@207: nico@207: <p> nico@207: nico@207: <p> nico@210: Definition at line <a class="el" href="timer_8c-source.html#l00042">42</a> of file <a class="el" href="timer_8c-source.html">timer.c</a>. nico@210: <p> nico@210: Referenced by <a class="el" href="timer_8c-source.html#l00112">DelAlarm()</a>, <a class="el" href="timer_8c-source.html#l00057">SetAlarm()</a>, and <a class="el" href="timer_8c-source.html#l00131">TimeDispatch()</a>. nico@207: </div> nico@207: </div><p> etisserant@240: <a class="anchor" name="adb4c8d5876b377463d33bdeda56b575"></a><!-- doxytag: member="timer.c::timers" ref="adb4c8d5876b377463d33bdeda56b575" args="[MAX_NB_TIMER]" --> etisserant@240: <div class="memitem"> etisserant@240: <div class="memproto"> etisserant@240: <table class="memname"> etisserant@240: <tr> etisserant@240: <td class="memname"><a class="el" href="structstruct__s__timer__entry.html">s_timer_entry</a> <a class="el" href="timer_8c.html#adb4c8d5876b377463d33bdeda56b575">timers</a>[MAX_NB_TIMER] = {{TIMER_FREE, NULL, NULL, 0, 0, 0},} </td> nico@207: </tr> nico@207: </table> nico@207: </div> nico@207: <div class="memdoc"> nico@207: nico@207: <p> nico@207: nico@207: <p> nico@210: Definition at line <a class="el" href="timer_8c-source.html#l00039">39</a> of file <a class="el" href="timer_8c-source.html">timer.c</a>. nico@210: <p> nico@210: Referenced by <a class="el" href="timer_8c-source.html#l00112">DelAlarm()</a>, <a class="el" href="timer_8c-source.html#l00057">SetAlarm()</a>, and <a class="el" href="timer_8c-source.html#l00131">TimeDispatch()</a>. nico@207: </div> nico@207: </div><p> etisserant@240: <a class="anchor" name="242986a224c5a02d6341dd5bfdf71008"></a><!-- doxytag: member="timer.c::total_sleep_time" ref="242986a224c5a02d6341dd5bfdf71008" args="" --> etisserant@240: <div class="memitem"> etisserant@240: <div class="memproto"> etisserant@240: <table class="memname"> etisserant@240: <tr> etisserant@240: <td class="memname">TIMEVAL <a class="el" href="timer_8c.html#242986a224c5a02d6341dd5bfdf71008">total_sleep_time</a> = TIMEVAL_MAX </td> nico@207: </tr> nico@207: </table> nico@207: </div> nico@207: <div class="memdoc"> nico@207: nico@207: <p> nico@207: nico@207: <p> nico@210: Definition at line <a class="el" href="timer_8c-source.html#l00041">41</a> of file <a class="el" href="timer_8c-source.html">timer.c</a>. nico@210: <p> nico@210: Referenced by <a class="el" href="timer_8c-source.html#l00131">TimeDispatch()</a>. nico@210: </div> nico@210: </div><p> etisserant@240: <hr size="1"><address style="align: right;"><small>Generated on Mon Jul 2 19:10:42 2007 for CanFestival by nico@207: <a href="http://www.doxygen.org/index.html"> nico@207: <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> nico@207: </body> nico@207: </html>