207
|
1 |
\hypertarget{timers__unix_8c}{
|
|
2 |
\section{/home/epimerde/documents/tc11/Can\-Festival-3/drivers/timers\_\-unix/timers\_\-unix.c File Reference}
|
|
3 |
\label{timers__unix_8c}\index{/home/epimerde/documents/tc11/CanFestival-3/drivers/timers_unix/timers_unix.c@{/home/epimerde/documents/tc11/CanFestival-3/drivers/timers\_\-unix/timers\_\-unix.c}}
|
|
4 |
}
|
|
5 |
{\tt \#include $<$stdlib.h$>$}\par
|
|
6 |
{\tt \#include $<$sys/time.h$>$}\par
|
|
7 |
{\tt \#include $<$pthread.h$>$}\par
|
|
8 |
{\tt \#include $<$signal.h$>$}\par
|
|
9 |
{\tt \#include \char`\"{}applicfg.h\char`\"{}}\par
|
|
10 |
{\tt \#include \char`\"{}timer.h\char`\"{}}\par
|
|
11 |
\subsection*{Defines}
|
|
12 |
\begin{CompactItemize}
|
|
13 |
\item
|
|
14 |
\#define \hyperlink{timers__unix_8c_016587a4d6fc754357c47c9df9f0bde4}{maxval}(a, b)~((a$>$b)?a:b)
|
|
15 |
\end{CompactItemize}
|
|
16 |
\subsection*{Functions}
|
|
17 |
\begin{CompactItemize}
|
|
18 |
\item
|
|
19 |
void \hyperlink{timers__unix_8c_d7fee43b8a44cf8b7036853593044037}{Enter\-Mutex} (void)
|
|
20 |
\item
|
|
21 |
void \hyperlink{timers__unix_8c_73d9a4eb941fb20cf6b597840510394b}{Leave\-Mutex} (void)
|
|
22 |
\item
|
|
23 |
void \hyperlink{timers__unix_8c_4cd19302f57b08fc0403a05017332735}{timer\_\-notify} (sigval\_\-t val)
|
|
24 |
\item
|
|
25 |
void \hyperlink{timers__unix_8c_02922529b60419a94afe8f369dda070b}{init\-Timer} (void)
|
|
26 |
\item
|
|
27 |
void \hyperlink{timers__unix_8c_8758484f3cebb0cd44bb247c3f23d5e3}{Stop\-Timer\-Loop} (void)
|
|
28 |
\item
|
|
29 |
void \hyperlink{timers__unix_8c_c9e1731843825eb55e7a94894e6a8ec5}{Start\-Timer\-Loop} (\hyperlink{timer_8h_f7d102e060339d3730ceae5fea03691b}{Timer\-Callback\_\-t} init\_\-callback)
|
|
30 |
\item
|
|
31 |
void \hyperlink{timers__unix_8c_a3a7df911baa20b01c4374a9677a154a}{Create\-Receive\-Task} (\hyperlink{win32_2applicfg_8h_7ef59f941603c6680e74fc335523f17e}{CAN\_\-PORT} port, TASK\_\-HANDLE $\ast$Thread, void $\ast$Receive\-Loop\-Ptr)
|
|
32 |
\item
|
|
33 |
void \hyperlink{timers__unix_8c_4b2486891ee01e06e2deead4cf963727}{Wait\-Receive\-Task\-End} (TASK\_\-HANDLE Thread)
|
|
34 |
\item
|
|
35 |
void \hyperlink{timers__unix_8c_b8d05dee70f04b5c5190ab00e84da106}{set\-Timer} (TIMEVAL value)
|
|
36 |
\item
|
|
37 |
TIMEVAL \hyperlink{timers__unix_8c_4dccc204d52176bd547ab34d6858f5ba}{get\-Elapsed\-Time} (void)
|
|
38 |
\end{CompactItemize}
|
|
39 |
\subsection*{Variables}
|
|
40 |
\begin{CompactItemize}
|
|
41 |
\item
|
|
42 |
pthread\_\-mutex\_\-t \hyperlink{timers__unix_8c_93ad8a5a5e353192bfa45ae850df337f}{Can\-Festival\_\-mutex} = PTHREAD\_\-MUTEX\_\-INITIALIZER
|
|
43 |
\item
|
|
44 |
TASK\_\-HANDLE \hyperlink{timers__unix_8c_ef197e4f64855d2ac4ccbc40595d6bdd}{Timer\-Loop\-Thread}
|
|
45 |
\item
|
|
46 |
TIMEVAL \hyperlink{timers__unix_8c_9b886230a6b35bdd1532a27ee7400d10}{last\_\-time\_\-set} = TIMEVAL\_\-MAX
|
|
47 |
\item
|
|
48 |
timeval \hyperlink{timers__unix_8c_bcf9307062fc6f0a7906547a892e38df}{last\_\-sig}
|
|
49 |
\item
|
|
50 |
timer\_\-t \hyperlink{timers__unix_8c_1a1e2de3a80567484c9b4d4f20d5a3d0}{timer}
|
|
51 |
\end{CompactItemize}
|
|
52 |
|
|
53 |
|
|
54 |
\subsection{Define Documentation}
|
|
55 |
\hypertarget{timers__unix_8c_016587a4d6fc754357c47c9df9f0bde4}{
|
|
56 |
\index{timers_unix.c@{timers\_\-unix.c}!maxval@{maxval}}
|
|
57 |
\index{maxval@{maxval}!timers_unix.c@{timers\_\-unix.c}}
|
|
58 |
\subsubsection[maxval]{\setlength{\rightskip}{0pt plus 5cm}\#define maxval(a, b)~((a$>$b)?a:b)}}
|
|
59 |
\label{timers__unix_8c_016587a4d6fc754357c47c9df9f0bde4}
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
Definition at line 82 of file timers\_\-unix.c.
|
|
65 |
|
|
66 |
\subsection{Function Documentation}
|
|
67 |
\hypertarget{timers__unix_8c_a3a7df911baa20b01c4374a9677a154a}{
|
|
68 |
\index{timers_unix.c@{timers\_\-unix.c}!CreateReceiveTask@{CreateReceiveTask}}
|
|
69 |
\index{CreateReceiveTask@{CreateReceiveTask}!timers_unix.c@{timers\_\-unix.c}}
|
|
70 |
\subsubsection[CreateReceiveTask]{\setlength{\rightskip}{0pt plus 5cm}void Create\-Receive\-Task (\hyperlink{win32_2applicfg_8h_7ef59f941603c6680e74fc335523f17e}{CAN\_\-PORT} {\em port}, TASK\_\-HANDLE $\ast$ {\em Thread}, void $\ast$ {\em Receive\-Loop\-Ptr})}}
|
|
71 |
\label{timers__unix_8c_a3a7df911baa20b01c4374a9677a154a}
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
Definition at line 71 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_d7fee43b8a44cf8b7036853593044037}{
|
|
77 |
\index{timers_unix.c@{timers\_\-unix.c}!EnterMutex@{EnterMutex}}
|
|
78 |
\index{EnterMutex@{EnterMutex}!timers_unix.c@{timers\_\-unix.c}}
|
|
79 |
\subsubsection[EnterMutex]{\setlength{\rightskip}{0pt plus 5cm}void Enter\-Mutex (void)}}
|
|
80 |
\label{timers__unix_8c_d7fee43b8a44cf8b7036853593044037}
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
Definition at line 20 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_4dccc204d52176bd547ab34d6858f5ba}{
|
|
86 |
\index{timers_unix.c@{timers\_\-unix.c}!getElapsedTime@{getElapsedTime}}
|
|
87 |
\index{getElapsedTime@{getElapsedTime}!timers_unix.c@{timers\_\-unix.c}}
|
|
88 |
\subsubsection[getElapsedTime]{\setlength{\rightskip}{0pt plus 5cm}TIMEVAL get\-Elapsed\-Time (void)}}
|
|
89 |
\label{timers__unix_8c_4dccc204d52176bd547ab34d6858f5ba}
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
Definition at line 98 of file timers\_\-unix.c.
|
|
95 |
|
|
96 |
References last\_\-sig.\hypertarget{timers__unix_8c_02922529b60419a94afe8f369dda070b}{
|
|
97 |
\index{timers_unix.c@{timers\_\-unix.c}!initTimer@{initTimer}}
|
|
98 |
\index{initTimer@{initTimer}!timers_unix.c@{timers\_\-unix.c}}
|
|
99 |
\subsubsection[initTimer]{\setlength{\rightskip}{0pt plus 5cm}void init\-Timer (void)}}
|
|
100 |
\label{timers__unix_8c_02922529b60419a94afe8f369dda070b}
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
Definition at line 39 of file timers\_\-unix.c.
|
|
106 |
|
|
107 |
References IO\_\-PORTS\_\-8, last\_\-sig, lock(), TCTL1, TIE, timer, timer\_\-notify(), TIOS, TSCR1, TSCR2, and unlock().\hypertarget{timers__unix_8c_73d9a4eb941fb20cf6b597840510394b}{
|
|
108 |
\index{timers_unix.c@{timers\_\-unix.c}!LeaveMutex@{LeaveMutex}}
|
|
109 |
\index{LeaveMutex@{LeaveMutex}!timers_unix.c@{timers\_\-unix.c}}
|
|
110 |
\subsubsection[LeaveMutex]{\setlength{\rightskip}{0pt plus 5cm}void Leave\-Mutex (void)}}
|
|
111 |
\label{timers__unix_8c_73d9a4eb941fb20cf6b597840510394b}
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
Definition at line 25 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_b8d05dee70f04b5c5190ab00e84da106}{
|
|
117 |
\index{timers_unix.c@{timers\_\-unix.c}!setTimer@{setTimer}}
|
|
118 |
\index{setTimer@{setTimer}!timers_unix.c@{timers\_\-unix.c}}
|
|
119 |
\subsubsection[setTimer]{\setlength{\rightskip}{0pt plus 5cm}void set\-Timer (TIMEVAL {\em value})}}
|
|
120 |
\label{timers__unix_8c_b8d05dee70f04b5c5190ab00e84da106}
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
Definition at line 83 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_c9e1731843825eb55e7a94894e6a8ec5}{
|
|
126 |
\index{timers_unix.c@{timers\_\-unix.c}!StartTimerLoop@{StartTimerLoop}}
|
|
127 |
\index{StartTimerLoop@{StartTimerLoop}!timers_unix.c@{timers\_\-unix.c}}
|
|
128 |
\subsubsection[StartTimerLoop]{\setlength{\rightskip}{0pt plus 5cm}void Start\-Timer\-Loop (\hyperlink{timer_8h_f7d102e060339d3730ceae5fea03691b}{Timer\-Callback\_\-t} {\em init\_\-callback})}}
|
|
129 |
\label{timers__unix_8c_c9e1731843825eb55e7a94894e6a8ec5}
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
134 |
Definition at line 62 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_8758484f3cebb0cd44bb247c3f23d5e3}{
|
|
135 |
\index{timers_unix.c@{timers\_\-unix.c}!StopTimerLoop@{StopTimerLoop}}
|
|
136 |
\index{StopTimerLoop@{StopTimerLoop}!timers_unix.c@{timers\_\-unix.c}}
|
|
137 |
\subsubsection[StopTimerLoop]{\setlength{\rightskip}{0pt plus 5cm}void Stop\-Timer\-Loop (void)}}
|
|
138 |
\label{timers__unix_8c_8758484f3cebb0cd44bb247c3f23d5e3}
|
|
139 |
|
|
140 |
|
|
141 |
|
|
142 |
|
|
143 |
Definition at line 55 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_4cd19302f57b08fc0403a05017332735}{
|
|
144 |
\index{timers_unix.c@{timers\_\-unix.c}!timer_notify@{timer\_\-notify}}
|
|
145 |
\index{timer_notify@{timer\_\-notify}!timers_unix.c@{timers\_\-unix.c}}
|
|
146 |
\subsubsection[timer\_\-notify]{\setlength{\rightskip}{0pt plus 5cm}void timer\_\-notify (sigval\_\-t {\em val})}}
|
|
147 |
\label{timers__unix_8c_4cd19302f57b08fc0403a05017332735}
|
|
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
Definition at line 30 of file timers\_\-unix.c.
|
|
153 |
|
|
154 |
References Enter\-Mutex(), last\_\-sig, Leave\-Mutex(), and Time\-Dispatch().\hypertarget{timers__unix_8c_4b2486891ee01e06e2deead4cf963727}{
|
|
155 |
\index{timers_unix.c@{timers\_\-unix.c}!WaitReceiveTaskEnd@{WaitReceiveTaskEnd}}
|
|
156 |
\index{WaitReceiveTaskEnd@{WaitReceiveTaskEnd}!timers_unix.c@{timers\_\-unix.c}}
|
|
157 |
\subsubsection[WaitReceiveTaskEnd]{\setlength{\rightskip}{0pt plus 5cm}void Wait\-Receive\-Task\-End (TASK\_\-HANDLE {\em Thread})}}
|
|
158 |
\label{timers__unix_8c_4b2486891ee01e06e2deead4cf963727}
|
|
159 |
|
|
160 |
|
|
161 |
|
|
162 |
|
|
163 |
Definition at line 76 of file timers\_\-unix.c.
|
|
164 |
|
|
165 |
\subsection{Variable Documentation}
|
|
166 |
\hypertarget{timers__unix_8c_93ad8a5a5e353192bfa45ae850df337f}{
|
|
167 |
\index{timers_unix.c@{timers\_\-unix.c}!CanFestival_mutex@{CanFestival\_\-mutex}}
|
|
168 |
\index{CanFestival_mutex@{CanFestival\_\-mutex}!timers_unix.c@{timers\_\-unix.c}}
|
|
169 |
\subsubsection[CanFestival\_\-mutex]{\setlength{\rightskip}{0pt plus 5cm}pthread\_\-mutex\_\-t \hyperlink{timers__xeno_8c_b6ebfe5bfc980bae026866758af3a7ff}{Can\-Festival\_\-mutex} = PTHREAD\_\-MUTEX\_\-INITIALIZER}}
|
|
170 |
\label{timers__unix_8c_93ad8a5a5e353192bfa45ae850df337f}
|
|
171 |
|
|
172 |
|
|
173 |
|
|
174 |
|
|
175 |
Definition at line 10 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_bcf9307062fc6f0a7906547a892e38df}{
|
|
176 |
\index{timers_unix.c@{timers\_\-unix.c}!last_sig@{last\_\-sig}}
|
|
177 |
\index{last_sig@{last\_\-sig}!timers_unix.c@{timers\_\-unix.c}}
|
|
178 |
\subsubsection[last\_\-sig]{\setlength{\rightskip}{0pt plus 5cm}struct timeval \hyperlink{timers__unix_8c_bcf9307062fc6f0a7906547a892e38df}{last\_\-sig}}}
|
|
179 |
\label{timers__unix_8c_bcf9307062fc6f0a7906547a892e38df}
|
|
180 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
184 |
Definition at line 16 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_9b886230a6b35bdd1532a27ee7400d10}{
|
|
185 |
\index{timers_unix.c@{timers\_\-unix.c}!last_time_set@{last\_\-time\_\-set}}
|
|
186 |
\index{last_time_set@{last\_\-time\_\-set}!timers_unix.c@{timers\_\-unix.c}}
|
|
187 |
\subsubsection[last\_\-time\_\-set]{\setlength{\rightskip}{0pt plus 5cm}TIMEVAL \hyperlink{timers__unix_8c_9b886230a6b35bdd1532a27ee7400d10}{last\_\-time\_\-set} = TIMEVAL\_\-MAX}}
|
|
188 |
\label{timers__unix_8c_9b886230a6b35bdd1532a27ee7400d10}
|
|
189 |
|
|
190 |
|
|
191 |
|
|
192 |
|
|
193 |
Definition at line 14 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_1a1e2de3a80567484c9b4d4f20d5a3d0}{
|
|
194 |
\index{timers_unix.c@{timers\_\-unix.c}!timer@{timer}}
|
|
195 |
\index{timer@{timer}!timers_unix.c@{timers\_\-unix.c}}
|
|
196 |
\subsubsection[timer]{\setlength{\rightskip}{0pt plus 5cm}timer\_\-t \hyperlink{timers__unix_8c_1a1e2de3a80567484c9b4d4f20d5a3d0}{timer}}}
|
|
197 |
\label{timers__unix_8c_1a1e2de3a80567484c9b4d4f20d5a3d0}
|
|
198 |
|
|
199 |
|
|
200 |
|
|
201 |
|
|
202 |
Definition at line 18 of file timers\_\-unix.c.\hypertarget{timers__unix_8c_ef197e4f64855d2ac4ccbc40595d6bdd}{
|
|
203 |
\index{timers_unix.c@{timers\_\-unix.c}!TimerLoopThread@{TimerLoopThread}}
|
|
204 |
\index{TimerLoopThread@{TimerLoopThread}!timers_unix.c@{timers\_\-unix.c}}
|
|
205 |
\subsubsection[TimerLoopThread]{\setlength{\rightskip}{0pt plus 5cm}TASK\_\-HANDLE \hyperlink{timers__unix_8c_ef197e4f64855d2ac4ccbc40595d6bdd}{Timer\-Loop\-Thread}}}
|
|
206 |
\label{timers__unix_8c_ef197e4f64855d2ac4ccbc40595d6bdd}
|
|
207 |
|
|
208 |
|
|
209 |
|
|
210 |
|
|
211 |
Definition at line 12 of file timers\_\-unix.c. |