<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>CanFestival: /home/epimerde/documents/tc11/CanFestival-3/drivers/timers_unix/timers_unix.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.1 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li id="current"><a href="files.html"><span>Files</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul></div>
<h1>/home/epimerde/documents/tc11/CanFestival-3/drivers/timers_unix/timers_unix.c File Reference</h1><code>#include <stdlib.h></code><br>
<code>#include <sys/time.h></code><br>
<code>#include <pthread.h></code><br>
<code>#include <signal.h></code><br>
<code>#include "<a class="el" href="win32_2applicfg_8h-source.html">applicfg.h</a>"</code><br>
<code>#include "<a class="el" href="timer_8h-source.html">timer.h</a>"</code><br>
<p>
<a href="timers__unix_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#016587a4d6fc754357c47c9df9f0bde4">maxval</a>(a, b) ((a>b)?a:b)</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#d7fee43b8a44cf8b7036853593044037">EnterMutex</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#73d9a4eb941fb20cf6b597840510394b">LeaveMutex</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#4cd19302f57b08fc0403a05017332735">timer_notify</a> (sigval_t val)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#02922529b60419a94afe8f369dda070b">initTimer</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#8758484f3cebb0cd44bb247c3f23d5e3">StopTimerLoop</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#c9e1731843825eb55e7a94894e6a8ec5">StartTimerLoop</a> (<a class="el" href="timer_8h.html#f7d102e060339d3730ceae5fea03691b">TimerCallback_t</a> init_callback)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#a3a7df911baa20b01c4374a9677a154a">CreateReceiveTask</a> (<a class="el" href="win32_2applicfg_8h.html#7ef59f941603c6680e74fc335523f17e">CAN_PORT</a> port, TASK_HANDLE *Thread, void *ReceiveLoopPtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#4b2486891ee01e06e2deead4cf963727">WaitReceiveTaskEnd</a> (TASK_HANDLE Thread)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#b8d05dee70f04b5c5190ab00e84da106">setTimer</a> (TIMEVAL value)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">TIMEVAL </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#4dccc204d52176bd547ab34d6858f5ba">getElapsedTime</a> (void)</td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">pthread_mutex_t </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#93ad8a5a5e353192bfa45ae850df337f">CanFestival_mutex</a> = PTHREAD_MUTEX_INITIALIZER</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">TASK_HANDLE </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#ef197e4f64855d2ac4ccbc40595d6bdd">TimerLoopThread</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">TIMEVAL </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#9b886230a6b35bdd1532a27ee7400d10">last_time_set</a> = TIMEVAL_MAX</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">timeval </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#bcf9307062fc6f0a7906547a892e38df">last_sig</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">timer_t </td><td class="memItemRight" valign="bottom"><a class="el" href="timers__unix_8c.html#1a1e2de3a80567484c9b4d4f20d5a3d0">timer</a></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="016587a4d6fc754357c47c9df9f0bde4"></a><!-- doxytag: member="timers_unix.c::maxval" ref="016587a4d6fc754357c47c9df9f0bde4" args="(a, b)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define maxval </td>
<td>(</td>
<td class="paramtype">a, <tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">b </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> ((a>b)?a:b)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00082">82</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a3a7df911baa20b01c4374a9677a154a"></a><!-- doxytag: member="timers_unix.c::CreateReceiveTask" ref="a3a7df911baa20b01c4374a9677a154a" args="(CAN_PORT port, TASK_HANDLE *Thread, void *ReceiveLoopPtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CreateReceiveTask </td>
<td>(</td>
<td class="paramtype"><a class="el" href="win32_2applicfg_8h.html#7ef59f941603c6680e74fc335523f17e">CAN_PORT</a> </td>
<td class="paramname"> <em>port</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">TASK_HANDLE * </td>
<td class="paramname"> <em>Thread</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>ReceiveLoopPtr</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00071">71</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="d7fee43b8a44cf8b7036853593044037"></a><!-- doxytag: member="timers_unix.c::EnterMutex" ref="d7fee43b8a44cf8b7036853593044037" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void EnterMutex </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00020">20</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="4dccc204d52176bd547ab34d6858f5ba"></a><!-- doxytag: member="timers_unix.c::getElapsedTime" ref="4dccc204d52176bd547ab34d6858f5ba" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TIMEVAL getElapsedTime </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00098">98</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
<p>
References <a class="el" href="timers__unix_8c-source.html#l00016">last_sig</a>.
</div>
</div><p>
<a class="anchor" name="02922529b60419a94afe8f369dda070b"></a><!-- doxytag: member="timers_unix.c::initTimer" ref="02922529b60419a94afe8f369dda070b" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void initTimer </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00039">39</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
<p>
References <a class="el" href="portsaccess_8h-source.html#l00039">IO_PORTS_8</a>, <a class="el" href="timers__unix_8c-source.html#l00016">last_sig</a>, <a class="el" href="interrupt_8c-source.html#l00049">lock()</a>, <a class="el" href="ports__def_8h-source.html#l00103">TCTL1</a>, <a class="el" href="ports__def_8h-source.html#l00107">TIE</a>, <a class="el" href="timers__unix_8c-source.html#l00018">timer</a>, <a class="el" href="timers__unix_8c-source.html#l00030">timer_notify()</a>, <a class="el" href="ports__def_8h-source.html#l00095">TIOS</a>, <a class="el" href="ports__def_8h-source.html#l00101">TSCR1</a>, <a class="el" href="ports__def_8h-source.html#l00108">TSCR2</a>, and <a class="el" href="interrupt_8c-source.html#l00057">unlock()</a>.
</div>
</div><p>
<a class="anchor" name="73d9a4eb941fb20cf6b597840510394b"></a><!-- doxytag: member="timers_unix.c::LeaveMutex" ref="73d9a4eb941fb20cf6b597840510394b" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void LeaveMutex </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00025">25</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="b8d05dee70f04b5c5190ab00e84da106"></a><!-- doxytag: member="timers_unix.c::setTimer" ref="b8d05dee70f04b5c5190ab00e84da106" args="(TIMEVAL value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void setTimer </td>
<td>(</td>
<td class="paramtype">TIMEVAL </td>
<td class="paramname"> <em>value</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00083">83</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="c9e1731843825eb55e7a94894e6a8ec5"></a><!-- doxytag: member="timers_unix.c::StartTimerLoop" ref="c9e1731843825eb55e7a94894e6a8ec5" args="(TimerCallback_t init_callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void StartTimerLoop </td>
<td>(</td>
<td class="paramtype"><a class="el" href="timer_8h.html#f7d102e060339d3730ceae5fea03691b">TimerCallback_t</a> </td>
<td class="paramname"> <em>init_callback</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00062">62</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="8758484f3cebb0cd44bb247c3f23d5e3"></a><!-- doxytag: member="timers_unix.c::StopTimerLoop" ref="8758484f3cebb0cd44bb247c3f23d5e3" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void StopTimerLoop </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00055">55</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="4cd19302f57b08fc0403a05017332735"></a><!-- doxytag: member="timers_unix.c::timer_notify" ref="4cd19302f57b08fc0403a05017332735" args="(sigval_t val)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void timer_notify </td>
<td>(</td>
<td class="paramtype">sigval_t </td>
<td class="paramname"> <em>val</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00030">30</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
<p>
References <a class="el" href="timers__unix_8c-source.html#l00020">EnterMutex()</a>, <a class="el" href="timers__unix_8c-source.html#l00016">last_sig</a>, <a class="el" href="timers__unix_8c-source.html#l00025">LeaveMutex()</a>, and <a class="el" href="timer_8c-source.html#l00104">TimeDispatch()</a>.
</div>
</div><p>
<a class="anchor" name="4b2486891ee01e06e2deead4cf963727"></a><!-- doxytag: member="timers_unix.c::WaitReceiveTaskEnd" ref="4b2486891ee01e06e2deead4cf963727" args="(TASK_HANDLE Thread)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WaitReceiveTaskEnd </td>
<td>(</td>
<td class="paramtype">TASK_HANDLE </td>
<td class="paramname"> <em>Thread</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00076">76</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="93ad8a5a5e353192bfa45ae850df337f"></a><!-- doxytag: member="timers_unix.c::CanFestival_mutex" ref="93ad8a5a5e353192bfa45ae850df337f" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">pthread_mutex_t <a class="el" href="timers__xeno_8c.html#b6ebfe5bfc980bae026866758af3a7ff">CanFestival_mutex</a> = PTHREAD_MUTEX_INITIALIZER </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00010">10</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="bcf9307062fc6f0a7906547a892e38df"></a><!-- doxytag: member="timers_unix.c::last_sig" ref="bcf9307062fc6f0a7906547a892e38df" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct timeval <a class="el" href="timers__unix_8c.html#bcf9307062fc6f0a7906547a892e38df">last_sig</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00016">16</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="9b886230a6b35bdd1532a27ee7400d10"></a><!-- doxytag: member="timers_unix.c::last_time_set" ref="9b886230a6b35bdd1532a27ee7400d10" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TIMEVAL <a class="el" href="timers__unix_8c.html#9b886230a6b35bdd1532a27ee7400d10">last_time_set</a> = TIMEVAL_MAX </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00014">14</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="1a1e2de3a80567484c9b4d4f20d5a3d0"></a><!-- doxytag: member="timers_unix.c::timer" ref="1a1e2de3a80567484c9b4d4f20d5a3d0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">timer_t <a class="el" href="timers__unix_8c.html#1a1e2de3a80567484c9b4d4f20d5a3d0">timer</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00018">18</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<a class="anchor" name="ef197e4f64855d2ac4ccbc40595d6bdd"></a><!-- doxytag: member="timers_unix.c::TimerLoopThread" ref="ef197e4f64855d2ac4ccbc40595d6bdd" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TASK_HANDLE <a class="el" href="timers__unix_8c.html#ef197e4f64855d2ac4ccbc40595d6bdd">TimerLoopThread</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<p>
Definition at line <a class="el" href="timers__unix_8c-source.html#l00012">12</a> of file <a class="el" href="timers__unix_8c-source.html">timers_unix.c</a>.
</div>
</div><p>
<hr size="1"><address style="align: right;"><small>Generated on Mon Jun 4 16:29:07 2007 for CanFestival by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
</body>
</html>