timer_8cpp.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.10"/>
  7. <title>CoffeePi: timer.cpp File Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="search/searchdata.js"></script>
  13. <script type="text/javascript" src="search/search.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(function() { init_search(); });
  16. </script>
  17. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body>
  20. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  21. <div id="titlearea">
  22. <table cellspacing="0" cellpadding="0">
  23. <tbody>
  24. <tr style="height: 56px;">
  25. <td id="projectalign" style="padding-left: 0.5em;">
  26. <div id="projectname">CoffeePi
  27. </div>
  28. <div id="projectbrief">Coffee machine control for Raspberry Pi</div>
  29. </td>
  30. </tr>
  31. </tbody>
  32. </table>
  33. </div>
  34. <!-- end header part -->
  35. <!-- Generated by Doxygen 1.8.10 -->
  36. <script type="text/javascript">
  37. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  38. </script>
  39. <div id="navrow1" class="tabs">
  40. <ul class="tablist">
  41. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  42. <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  43. <li class="current"><a href="files.html"><span>Files</span></a></li>
  44. <li>
  45. <div id="MSearchBox" class="MSearchBoxInactive">
  46. <span class="left">
  47. <img id="MSearchSelect" src="search/mag_sel.png"
  48. onmouseover="return searchBox.OnSearchSelectShow()"
  49. onmouseout="return searchBox.OnSearchSelectHide()"
  50. alt=""/>
  51. <input type="text" id="MSearchField" value="Search" accesskey="S"
  52. onfocus="searchBox.OnSearchFieldFocus(true)"
  53. onblur="searchBox.OnSearchFieldFocus(false)"
  54. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  55. </span><span class="right">
  56. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  57. </span>
  58. </div>
  59. </li>
  60. </ul>
  61. </div>
  62. <div id="navrow2" class="tabs2">
  63. <ul class="tablist">
  64. <li><a href="files.html"><span>File&#160;List</span></a></li>
  65. <li><a href="globals.html"><span>Globals</span></a></li>
  66. </ul>
  67. </div>
  68. <!-- window showing the filter options -->
  69. <div id="MSearchSelectWindow"
  70. onmouseover="return searchBox.OnSearchSelectShow()"
  71. onmouseout="return searchBox.OnSearchSelectHide()"
  72. onkeydown="return searchBox.OnSearchSelectKey(event)">
  73. </div>
  74. <!-- iframe showing the search results (closed by default) -->
  75. <div id="MSearchResultsWindow">
  76. <iframe src="javascript:void(0)" frameborder="0"
  77. name="MSearchResults" id="MSearchResults">
  78. </iframe>
  79. </div>
  80. </div><!-- top -->
  81. <div class="header">
  82. <div class="summary">
  83. <a href="#func-members">Functions</a> &#124;
  84. <a href="#var-members">Variables</a> </div>
  85. <div class="headertitle">
  86. <div class="title">timer.cpp File Reference</div> </div>
  87. </div><!--header-->
  88. <div class="contents">
  89. <div class="textblock"><code>#include &lt;csignal&gt;</code><br />
  90. <code>#include &lt;stdio.h&gt;</code><br />
  91. <code>#include &lt;stdlib.h&gt;</code><br />
  92. <code>#include &lt;string.h&gt;</code><br />
  93. <code>#include &lt;time.h&gt;</code><br />
  94. <code>#include &lt;pthread.h&gt;</code><br />
  95. <code>#include &lt;errno.h&gt;</code><br />
  96. <code>#include &quot;<a class="el" href="global_8h_source.html">global.h</a>&quot;</code><br />
  97. <code>#include &quot;<a class="el" href="timer_8h_source.html">timer.h</a>&quot;</code><br />
  98. <code>#include &quot;<a class="el" href="logger_8h_source.html">logger.h</a>&quot;</code><br />
  99. </div><table class="memberdecls">
  100. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  101. Functions</h2></td></tr>
  102. <tr class="memitem:a69a9ecb245422cbf03f28336a3cde462"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8cpp.html#a69a9ecb245422cbf03f28336a3cde462">timer_handler</a> (int sig, siginfo_t *si, void *uc)</td></tr>
  103. <tr class="memdesc:a69a9ecb245422cbf03f28336a3cde462"><td class="mdescLeft">&#160;</td><td class="mdescRight">this method is called by the system timer and handles the other timers <a href="#a69a9ecb245422cbf03f28336a3cde462">More...</a><br /></td></tr>
  104. <tr class="separator:a69a9ecb245422cbf03f28336a3cde462"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. <tr class="memitem:a9e737e3249388fb2e50d868bad69c688"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8cpp.html#a9e737e3249388fb2e50d868bad69c688">initTimers</a> (void)</td></tr>
  106. <tr class="memdesc:a9e737e3249388fb2e50d868bad69c688"><td class="mdescLeft">&#160;</td><td class="mdescRight">inits the system timer based on signals <a href="#a9e737e3249388fb2e50d868bad69c688">More...</a><br /></td></tr>
  107. <tr class="separator:a9e737e3249388fb2e50d868bad69c688"><td class="memSeparator" colspan="2">&#160;</td></tr>
  108. <tr class="memitem:a43ed436d8c1803ced3029a909320a841"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8cpp.html#a43ed436d8c1803ced3029a909320a841">stopTimers</a> (void)</td></tr>
  109. <tr class="memdesc:a43ed436d8c1803ced3029a909320a841"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops all existing timers. <a href="#a43ed436d8c1803ced3029a909320a841">More...</a><br /></td></tr>
  110. <tr class="separator:a43ed436d8c1803ced3029a909320a841"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <tr class="memitem:ae9859727c0e51a70b4ff5f47d2527a77"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8cpp.html#ae9859727c0e51a70b4ff5f47d2527a77">nullThread</a> (void *threadid)</td></tr>
  112. <tr class="memdesc:ae9859727c0e51a70b4ff5f47d2527a77"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is a dummy thread. <a href="#ae9859727c0e51a70b4ff5f47d2527a77">More...</a><br /></td></tr>
  113. <tr class="separator:ae9859727c0e51a70b4ff5f47d2527a77"><td class="memSeparator" colspan="2">&#160;</td></tr>
  114. </table><table class="memberdecls">
  115. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
  116. Variables</h2></td></tr>
  117. <tr class="memitem:a617a47c70795bcff659815ad0efd2266"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8cpp.html#a617a47c70795bcff659815ad0efd2266">counter</a> = 0</td></tr>
  118. <tr class="separator:a617a47c70795bcff659815ad0efd2266"><td class="memSeparator" colspan="2">&#160;</td></tr>
  119. <tr class="memitem:a0f94d5829b547df53531ff4c3ec325c0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8cpp.html#a0f94d5829b547df53531ff4c3ec325c0">timercnt</a> = 10</td></tr>
  120. <tr class="separator:a0f94d5829b547df53531ff4c3ec325c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  121. <tr class="memitem:acb6f6b56b317d16d17fd2f6df17547c3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classtimer.html">timer</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8cpp.html#acb6f6b56b317d16d17fd2f6df17547c3">firstTimer</a> = NULL</td></tr>
  122. <tr class="separator:acb6f6b56b317d16d17fd2f6df17547c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. <tr class="memitem:a16ed619aa4eb3fda56a001d0d7a8975d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classtimer.html">timer</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8cpp.html#a16ed619aa4eb3fda56a001d0d7a8975d">lastTimer</a> = NULL</td></tr>
  124. <tr class="separator:a16ed619aa4eb3fda56a001d0d7a8975d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  125. </table>
  126. <h2 class="groupheader">Function Documentation</h2>
  127. <a class="anchor" id="a9e737e3249388fb2e50d868bad69c688"></a>
  128. <div class="memitem">
  129. <div class="memproto">
  130. <table class="memname">
  131. <tr>
  132. <td class="memname">void initTimers </td>
  133. <td>(</td>
  134. <td class="paramtype">void&#160;</td>
  135. <td class="paramname"></td><td>)</td>
  136. <td></td>
  137. </tr>
  138. </table>
  139. </div><div class="memdoc">
  140. <p>inits the system timer based on signals </p>
  141. </div>
  142. </div>
  143. <a class="anchor" id="ae9859727c0e51a70b4ff5f47d2527a77"></a>
  144. <div class="memitem">
  145. <div class="memproto">
  146. <table class="memname">
  147. <tr>
  148. <td class="memname">void* nullThread </td>
  149. <td>(</td>
  150. <td class="paramtype">void *&#160;</td>
  151. <td class="paramname"><em>threadid</em></td><td>)</td>
  152. <td></td>
  153. </tr>
  154. </table>
  155. </div><div class="memdoc">
  156. <p>This is a dummy thread. </p>
  157. <dl class="params"><dt>Parameters</dt><dd>
  158. <table class="params">
  159. <tr><td class="paramname">*threadid</td><td>Thread ID </td></tr>
  160. </table>
  161. </dd>
  162. </dl>
  163. </div>
  164. </div>
  165. <a class="anchor" id="a43ed436d8c1803ced3029a909320a841"></a>
  166. <div class="memitem">
  167. <div class="memproto">
  168. <table class="memname">
  169. <tr>
  170. <td class="memname">void stopTimers </td>
  171. <td>(</td>
  172. <td class="paramtype">void&#160;</td>
  173. <td class="paramname"></td><td>)</td>
  174. <td></td>
  175. </tr>
  176. </table>
  177. </div><div class="memdoc">
  178. <p>Stops all existing timers. </p>
  179. </div>
  180. </div>
  181. <a class="anchor" id="a69a9ecb245422cbf03f28336a3cde462"></a>
  182. <div class="memitem">
  183. <div class="memproto">
  184. <table class="memname">
  185. <tr>
  186. <td class="memname">void timer_handler </td>
  187. <td>(</td>
  188. <td class="paramtype">int&#160;</td>
  189. <td class="paramname"><em>sig</em>, </td>
  190. </tr>
  191. <tr>
  192. <td class="paramkey"></td>
  193. <td></td>
  194. <td class="paramtype">siginfo_t *&#160;</td>
  195. <td class="paramname"><em>si</em>, </td>
  196. </tr>
  197. <tr>
  198. <td class="paramkey"></td>
  199. <td></td>
  200. <td class="paramtype">void *&#160;</td>
  201. <td class="paramname"><em>uc</em>&#160;</td>
  202. </tr>
  203. <tr>
  204. <td></td>
  205. <td>)</td>
  206. <td></td><td></td>
  207. </tr>
  208. </table>
  209. </div><div class="memdoc">
  210. <p>this method is called by the system timer and handles the other timers </p>
  211. </div>
  212. </div>
  213. <h2 class="groupheader">Variable Documentation</h2>
  214. <a class="anchor" id="a617a47c70795bcff659815ad0efd2266"></a>
  215. <div class="memitem">
  216. <div class="memproto">
  217. <table class="memname">
  218. <tr>
  219. <td class="memname">int counter = 0</td>
  220. </tr>
  221. </table>
  222. </div><div class="memdoc">
  223. </div>
  224. </div>
  225. <a class="anchor" id="acb6f6b56b317d16d17fd2f6df17547c3"></a>
  226. <div class="memitem">
  227. <div class="memproto">
  228. <table class="memname">
  229. <tr>
  230. <td class="memname"><a class="el" href="classtimer.html">timer</a>* firstTimer = NULL</td>
  231. </tr>
  232. </table>
  233. </div><div class="memdoc">
  234. </div>
  235. </div>
  236. <a class="anchor" id="a16ed619aa4eb3fda56a001d0d7a8975d"></a>
  237. <div class="memitem">
  238. <div class="memproto">
  239. <table class="memname">
  240. <tr>
  241. <td class="memname"><a class="el" href="classtimer.html">timer</a>* lastTimer = NULL</td>
  242. </tr>
  243. </table>
  244. </div><div class="memdoc">
  245. </div>
  246. </div>
  247. <a class="anchor" id="a0f94d5829b547df53531ff4c3ec325c0"></a>
  248. <div class="memitem">
  249. <div class="memproto">
  250. <table class="memname">
  251. <tr>
  252. <td class="memname">int timercnt = 10</td>
  253. </tr>
  254. </table>
  255. </div><div class="memdoc">
  256. </div>
  257. </div>
  258. </div><!-- contents -->
  259. <!-- start footer part -->
  260. <hr class="footer"/><address class="footer"><small>
  261. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  262. <img class="footer" src="doxygen.png" alt="doxygen"/>
  263. </a> 1.8.10
  264. </small></address>
  265. </body>
  266. </html>