gnuk/ChibiOS_2.0.2/docs/html/ch_8cpp_source.html
2010-08-10 12:11:02 +09:00

381 lines
53 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: ch.cpp Source File</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<h1>ch.cpp</h1><a href="ch_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment"> This file is part of ChibiOS/RT.</span>
<a name="l00005"></a>00005 <span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment"> ChibiOS/RT is free software; you can redistribute it and/or modify</span>
<a name="l00007"></a>00007 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
<a name="l00008"></a>00008 <span class="comment"> the Free Software Foundation; either version 3 of the License, or</span>
<a name="l00009"></a>00009 <span class="comment"> (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment"> ChibiOS/RT is distributed in the hope that it will be useful,</span>
<a name="l00012"></a>00012 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00013"></a>00013 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00014"></a>00014 <span class="comment"> GNU General Public License for more details.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment"> You should have received a copy of the GNU General Public License</span>
<a name="l00017"></a>00017 <span class="comment"> along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00018"></a>00018 <span class="comment"></span>
<a name="l00019"></a>00019 <span class="comment"> ---</span>
<a name="l00020"></a>00020 <span class="comment"></span>
<a name="l00021"></a>00021 <span class="comment"> A special exception to the GPL can be applied should you wish to distribute</span>
<a name="l00022"></a>00022 <span class="comment"> a combined work that includes ChibiOS/RT, without being obliged to provide</span>
<a name="l00023"></a>00023 <span class="comment"> the source code for any proprietary components. See the file exception.txt</span>
<a name="l00024"></a>00024 <span class="comment"> for full details of how and when the exception can be applied.</span>
<a name="l00025"></a>00025 <span class="comment">*/</span><span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment">/**</span>
<a name="l00027"></a>00027 <span class="comment"> * @file ch.cpp</span>
<a name="l00028"></a>00028 <span class="comment"> * @brief C++ wrapper code.</span>
<a name="l00029"></a>00029 <span class="comment"> * @addtogroup cpp_library</span>
<a name="l00030"></a>00030 <span class="comment"> * @{</span>
<a name="l00031"></a>00031 <span class="comment"> */</span>
<a name="l00032"></a>00032
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="ch_8hpp.html" title="C++ wrapper classes and definitions.">ch.hpp</a>&quot;</span>
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <span class="keyword">namespace </span>chibios_rt {
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="comment">/*------------------------------------------------------------------------*</span>
<a name="l00038"></a>00038 <span class="comment"> * chibios_rt::System *</span>
<a name="l00039"></a><a class="code" href="classchibios__rt_1_1_system.html#a368a84ccf6f537f7ba732829cbb29281">00039</a> <span class="comment"> *------------------------------------------------------------------------*/</span>
<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_system.html#a368a84ccf6f537f7ba732829cbb29281" title="ChibiOS/RT initialization.">System::Init</a>(<span class="keywordtype">void</span>) {
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <a class="code" href="group__system.html#gafe2c7de6567e98e487e009e81e3be10b" title="ChibiOS/RT initialization.">chSysInit</a>();
<a name="l00043"></a>00043 }
<a name="l00044"></a><a class="code" href="classchibios__rt_1_1_system.html#a464d3fc171938b9387872fc9cdaa78a6">00044</a>
<a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_system.html#a464d3fc171938b9387872fc9cdaa78a6" title="Kernel lock.">System::Lock</a>(<span class="keywordtype">void</span>) {
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <a class="code" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock</a>();
<a name="l00048"></a>00048 }
<a name="l00049"></a><a class="code" href="classchibios__rt_1_1_system.html#affaa69004bd8f952aebce80cffff673f">00049</a>
<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_system.html#affaa69004bd8f952aebce80cffff673f" title="Kernel unlock.">System::Unlock</a>(<span class="keywordtype">void</span>) {
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <a class="code" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock</a>();
<a name="l00053"></a>00053 }
<a name="l00054"></a><a class="code" href="classchibios__rt_1_1_system.html#a74fb442c63f2a34c0a81dbfa42319976">00054</a>
<a name="l00055"></a>00055 <a class="code" href="group__types.html#gae3e32a98d431a02106616da3071832dd" title="System Time, recommended fastest unsigned.">systime_t</a> <a class="code" href="classchibios__rt_1_1_system.html#a74fb442c63f2a34c0a81dbfa42319976" title="Returns the system time as system ticks.">System::GetTime</a>(<span class="keywordtype">void</span>) {
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keywordflow">return</span> <a class="code" href="group__time.html#ga137c8f67c450f34416a786d169be90e2" title="Current system time.">chTimeNow</a>();
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059
<a name="l00060"></a>00060 <span class="comment">/*------------------------------------------------------------------------*</span>
<a name="l00061"></a>00061 <span class="comment"> * chibios_rt::Timer *</span>
<a name="l00062"></a><a class="code" href="classchibios__rt_1_1_timer.html#a375cb7ce8108c24336016a94efd8a787">00062</a> <span class="comment"> *------------------------------------------------------------------------*/</span>
<a name="l00063"></a>00063 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_timer.html#a375cb7ce8108c24336016a94efd8a787" title="Starts the timer.">Timer::Set</a>(<a class="code" href="group__types.html#gae3e32a98d431a02106616da3071832dd" title="System Time, recommended fastest unsigned.">systime_t</a> time, <a class="code" href="group__time.html#gae6dbe55ffac66f346e05fd99cb4a76b2" title="Virtual Timer callback function.">vtfunc_t</a> vtfunc, <span class="keywordtype">void</span> *par) {
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <a class="code" href="group__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e" title="Enables a virtual timer.">chVTSetI</a>(&amp;<a class="code" href="classchibios__rt_1_1_timer.html#a0b126ef3347ec88a54c11e10070d4270" title="Embedded VirtualTimer structure.">timer</a>, time, vtfunc, par);
<a name="l00066"></a>00066 }
<a name="l00067"></a><a class="code" href="classchibios__rt_1_1_timer.html#a065b7fbc2a055152c39505ae91ea9754">00067</a>
<a name="l00068"></a>00068 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_timer.html#a065b7fbc2a055152c39505ae91ea9754" title="Resets the timer.">Timer::Reset</a>() {
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <a class="code" href="group__time.html#ga680d851a74e594cc965101e79891840f" title="Disables a Virtual Timer.">chVTResetI</a>(&amp;<a class="code" href="classchibios__rt_1_1_timer.html#a0b126ef3347ec88a54c11e10070d4270" title="Embedded VirtualTimer structure.">timer</a>);
<a name="l00071"></a>00071 }
<a name="l00072"></a><a class="code" href="classchibios__rt_1_1_timer.html#a97e29d53a4aaf2ef997732be63fdee6e">00072</a>
<a name="l00073"></a>00073 <span class="keywordtype">bool</span> <a class="code" href="classchibios__rt_1_1_timer.html#a97e29d53a4aaf2ef997732be63fdee6e" title="Returns the timer status.">Timer::IsArmed</a>(<span class="keywordtype">void</span>) {
<a name="l00074"></a>00074
<a name="l00075"></a>00075 <span class="keywordflow">return</span> <a class="code" href="group__time.html#gae54e6dd40bc7b9cdeb409393ec9e134a" title="Returns TRUE if the speciified timer is armed.">chVTIsArmedI</a>(&amp;<a class="code" href="classchibios__rt_1_1_timer.html#a0b126ef3347ec88a54c11e10070d4270" title="Embedded VirtualTimer structure.">timer</a>);
<a name="l00076"></a>00076 }
<a name="l00077"></a>00077
<a name="l00078"></a>00078 <span class="comment">/*------------------------------------------------------------------------*</span>
<a name="l00079"></a>00079 <span class="comment"> * chibios_rt::BaseThread *</span>
<a name="l00080"></a>00080 <span class="comment"> *------------------------------------------------------------------------*/</span>
<a name="l00081"></a>00081 <span class="keyword">static</span> <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> thdstart(<span class="keywordtype">void</span> *arg) {
<a name="l00082"></a>00082
<a name="l00083"></a>00083 <span class="keywordflow">return</span> ((<a class="code" href="classchibios__rt_1_1_base_thread.html" title="Base class for a ChibiOS/RT thread.">BaseThread</a> *)arg)-&gt;Main();
<a name="l00084"></a>00084 }
<a name="l00085"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a48012dd4151de3d40aa5139b230ed627">00085</a>
<a name="l00086"></a>00086 <a class="code" href="classchibios__rt_1_1_base_thread.html#a48012dd4151de3d40aa5139b230ed627" title="Thread constructor.">BaseThread::BaseThread</a>(<span class="keywordtype">void</span> *workspace, <span class="keywordtype">size_t</span> wsize, <a class="code" href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee" title="Priority, use the fastest unsigned type.">tprio_t</a> prio) {
<a name="l00087"></a>00087
<a name="l00088"></a>00088 <a class="code" href="classchibios__rt_1_1_base_thread.html#a5cfa916d9b0888507756a6d1be7e7778" title="Pointer to the system thread.">thread_ref</a> = <a class="code" href="group__threads.html#ga048e588238dd336c6059133b3d0c3435" title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(workspace, wsize, prio, thdstart, <span class="keyword">this</span>);
<a name="l00089"></a>00089 }
<a name="l00090"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#abc119aef948c9050d2e18a5a2686d88d">00090</a>
<a name="l00091"></a>00091 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_base_thread.html#abc119aef948c9050d2e18a5a2686d88d" title="Thread exit.">BaseThread::Exit</a>(<a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> msg) {
<a name="l00092"></a>00092
<a name="l00093"></a>00093 <a class="code" href="group__threads.html#ga24ab3a3a4d70214ee360867a1c3c75ac" title="Terminates the current thread by specifying an exit status code.">chThdExit</a>(msg);
<a name="l00094"></a>00094 }
<a name="l00095"></a>00095
<a name="l00096"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a8b4a3de70b98980e6836a48f3e97969c">00096</a> <span class="preprocessor">#if CH_USE_WAITEXIT</span>
<a name="l00097"></a>00097 <span class="preprocessor"></span> <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_base_thread.html#a8b4a3de70b98980e6836a48f3e97969c" title="Synchronization on Thread exit.">BaseThread::Wait</a>(<span class="keywordtype">void</span>) {
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="keywordflow">return</span> <a class="code" href="group__threads.html#ga94a5727ecdbe0f738dfc8e1ede1c3409" title="Blocks the execution of the invoking thread until the specified thread terminates...">chThdWait</a>(<a class="code" href="classchibios__rt_1_1_base_thread.html#a5cfa916d9b0888507756a6d1be7e7778" title="Pointer to the system thread.">thread_ref</a>);
<a name="l00100"></a>00100 }
<a name="l00101"></a>00101 <span class="preprocessor">#endif </span><span class="comment">/* CH_USE_WAITEXIT */</span>
<a name="l00102"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#aa824957049b5d62a4d23b0c9758b30a5">00102</a>
<a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_base_thread.html#aa824957049b5d62a4d23b0c9758b30a5" title="Changes the thread priority.">BaseThread::SetPriority</a>(<a class="code" href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee" title="Priority, use the fastest unsigned type.">tprio_t</a> newprio) {
<a name="l00104"></a>00104
<a name="l00105"></a>00105 <a class="code" href="group__threads.html#ga5a5d9388c64e4c1a3aec129d2831eefe" title="Changes the running thread priority level then reschedules if necessary.">chThdSetPriority</a>(newprio);
<a name="l00106"></a>00106 }
<a name="l00107"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a6cde6d5b592476aded69ee10b5adc912">00107</a>
<a name="l00108"></a>00108 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_base_thread.html#a6cde6d5b592476aded69ee10b5adc912" title="Resumes the thread.">BaseThread::Resume</a>(<span class="keywordtype">void</span>) {
<a name="l00109"></a>00109
<a name="l00110"></a>00110 <a class="code" href="group__threads.html#ga2c1ce2be73cd177af7e577b282232a7d" title="Resumes a suspended thread.">chThdResume</a>(<a class="code" href="classchibios__rt_1_1_base_thread.html#a5cfa916d9b0888507756a6d1be7e7778" title="Pointer to the system thread.">thread_ref</a>);
<a name="l00111"></a>00111 }
<a name="l00112"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a9391836cb66a13932044703d1833ae64">00112</a>
<a name="l00113"></a>00113 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_base_thread.html#a9391836cb66a13932044703d1833ae64" title="Requests thread termination.">BaseThread::Terminate</a>(<span class="keywordtype">void</span>) {
<a name="l00114"></a>00114
<a name="l00115"></a>00115 <a class="code" href="group__threads.html#ga7ea7371fa41598ebd523622587ce3f22" title="Requests a thread termination.">chThdTerminate</a>(<a class="code" href="classchibios__rt_1_1_base_thread.html#a5cfa916d9b0888507756a6d1be7e7778" title="Pointer to the system thread.">thread_ref</a>);
<a name="l00116"></a>00116 }
<a name="l00117"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a44de1239fc6517ddf735405dd7fc8463">00117</a>
<a name="l00118"></a>00118 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_base_thread.html#a44de1239fc6517ddf735405dd7fc8463" title="Suspends the thread execution for the specified number of system ticks.">BaseThread::Sleep</a>(<a class="code" href="group__types.html#gae3e32a98d431a02106616da3071832dd" title="System Time, recommended fastest unsigned.">systime_t</a> n) {
<a name="l00119"></a>00119
<a name="l00120"></a>00120 <a class="code" href="group__threads.html#ga8b10a49e2ec522a5ddecabdc453afcab" title="Suspends the invoking thread for the specified time.">chThdSleep</a>(n);
<a name="l00121"></a>00121 }
<a name="l00122"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a0589beba9bb4c959b3f49a82b24562eb">00122</a>
<a name="l00123"></a>00123 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_base_thread.html#a0589beba9bb4c959b3f49a82b24562eb" title="Suspends the thread execution until the specified time arrives.">BaseThread::SleepUntil</a>(<a class="code" href="group__types.html#gae3e32a98d431a02106616da3071832dd" title="System Time, recommended fastest unsigned.">systime_t</a> time) {
<a name="l00124"></a>00124
<a name="l00125"></a>00125 <a class="code" href="group__threads.html#ga9e6e2f8d46d415e8f0862daf0be1d984" title="Suspends the invoking thread until the system time arrives to the specified value...">chThdSleepUntil</a>(time);
<a name="l00126"></a>00126 }
<a name="l00127"></a>00127
<a name="l00128"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a1557c9e6e0b61a7eb848ce928115973d">00128</a> <span class="preprocessor">#if CH_USE_MESSAGES</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span> <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_base_thread.html#a1557c9e6e0b61a7eb848ce928115973d" title="Sends a message to the thread and returns the answer.">BaseThread::SendMessage</a>(::<a class="code" href="struct_thread.html" title="Structure representing a thread.">Thread</a>* tp, <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> msg) {
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="keywordflow">return</span> <a class="code" href="group__messages.html#ga29a48a438e97dc47cb798a84e13764cb" title="Sends a message to the specified thread.">chMsgSend</a>(tp, msg);
<a name="l00132"></a>00132 }
<a name="l00133"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a5c7600b2472318e1406d5c5dbc1a73d5">00133</a>
<a name="l00134"></a>00134 <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_base_thread.html#a1557c9e6e0b61a7eb848ce928115973d" title="Sends a message to the thread and returns the answer.">BaseThread::SendMessage</a>(<a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> msg) {
<a name="l00135"></a>00135
<a name="l00136"></a>00136 <span class="keywordflow">return</span> <a class="code" href="group__messages.html#ga29a48a438e97dc47cb798a84e13764cb" title="Sends a message to the specified thread.">chMsgSend</a>(<a class="code" href="classchibios__rt_1_1_base_thread.html#a5cfa916d9b0888507756a6d1be7e7778" title="Pointer to the system thread.">thread_ref</a>, msg);
<a name="l00137"></a>00137 }
<a name="l00138"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#ae960dbec72042a9072e35984523694b8">00138</a>
<a name="l00139"></a>00139 <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_base_thread.html#ae960dbec72042a9072e35984523694b8" title="Waits for a message and returns it.">BaseThread::WaitMessage</a>(<span class="keywordtype">void</span>) {
<a name="l00140"></a>00140
<a name="l00141"></a>00141 <span class="keywordflow">return</span> <a class="code" href="group__messages.html#gae68fefbf9d0404bbf56ae354961fae41" title="Suspends the thread and waits for an incoming message.">chMsgWait</a>();
<a name="l00142"></a>00142 }
<a name="l00143"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#ab8e737914200f075bf02ade85876764d">00143</a>
<a name="l00144"></a>00144 <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_base_thread.html#ab8e737914200f075bf02ade85876764d" title="Returns an enqueued message or NULL.">BaseThread::GetMessage</a>(<span class="keywordtype">void</span>) {
<a name="l00145"></a>00145
<a name="l00146"></a>00146 <span class="keywordflow">return</span> <a class="code" href="group__messages.html#ga65dda189b03b238412301ce5d80bfcf4" title="Returns the next message in the queue.">chMsgGet</a>();
<a name="l00147"></a>00147 }
<a name="l00148"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a4ecedb2d2b646ea4a9261c0e62f16945">00148</a>
<a name="l00149"></a>00149 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_base_thread.html#a4ecedb2d2b646ea4a9261c0e62f16945" title="Releases the next message in queue with a reply.">BaseThread::ReleaseMessage</a>(<a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> msg) {
<a name="l00150"></a>00150
<a name="l00151"></a>00151 <a class="code" href="group__messages.html#ga19a54b3b4b0e3677c47d650a3be3c7aa" title="Releases the thread waiting on top of the messages queue.">chMsgRelease</a>(msg);
<a name="l00152"></a>00152 }
<a name="l00153"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#a4477cb3ed6fc3250638bb21d8199f573">00153</a>
<a name="l00154"></a>00154 <span class="keywordtype">bool</span> <a class="code" href="classchibios__rt_1_1_base_thread.html#a4477cb3ed6fc3250638bb21d8199f573" title="Returns true if there is at least one message in queue.">BaseThread::IsPendingMessage</a>(<span class="keywordtype">void</span>) {
<a name="l00155"></a>00155
<a name="l00156"></a>00156 <span class="keywordflow">return</span> <a class="code" href="group__messages.html#ga4e0eafdfd51c042d765e2949e6171093" title="Evaluates to TRUE if the thread has pending messages.">chMsgIsPendingI</a>(<a class="code" href="group__scheduler.html#ga1a5fddde56420e8accd0c09c1abb32a7" title="Current thread pointer access macro.">currp</a>);
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158 <span class="preprocessor">#endif </span><span class="comment">/* CH_USE_MESSAGES */</span>
<a name="l00159"></a><a class="code" href="classchibios__rt_1_1_base_thread.html#ae973df26215c254288eaf844c7eef637">00159</a>
<a name="l00160"></a>00160 <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_base_thread.html#ae973df26215c254288eaf844c7eef637" title="Thread body function.">BaseThread::Main</a>(<span class="keywordtype">void</span>) {
<a name="l00161"></a>00161
<a name="l00162"></a>00162 <span class="keywordflow">return</span> 0;
<a name="l00163"></a>00163 }
<a name="l00164"></a>00164
<a name="l00165"></a>00165 <span class="preprocessor">#if CH_USE_SEMAPHORES</span>
<a name="l00166"></a>00166 <span class="preprocessor"></span> <span class="comment">/*------------------------------------------------------------------------*</span>
<a name="l00167"></a>00167 <span class="comment"> * chibios_rt::Semaphore *</span>
<a name="l00168"></a><a class="code" href="classchibios__rt_1_1_semaphore.html#a0804607c066a7a373188cb8220203f8f">00168</a> <span class="comment"> *------------------------------------------------------------------------*/</span>
<a name="l00169"></a>00169 <a class="code" href="classchibios__rt_1_1_semaphore.html#a0804607c066a7a373188cb8220203f8f" title="Semaphore constructor.">Semaphore::Semaphore</a>(<a class="code" href="group__types.html#ga090b3bab5602157ebf706a44041dc05e" title="Counter, recommended fastest signed.">cnt_t</a> n) {
<a name="l00170"></a>00170
<a name="l00171"></a>00171 <a class="code" href="group__semaphores.html#gafe8fc6155a871074e8017efd908b2c58" title="Initializes a semaphore with the specified counter value.">chSemInit</a>(&amp;<a class="code" href="classchibios__rt_1_1_semaphore.html#a604ce05f129534b4b3ad76366f2d90c5" title="Embedded Semaphore structure.">sem</a>, n);
<a name="l00172"></a>00172 }
<a name="l00173"></a><a class="code" href="classchibios__rt_1_1_semaphore.html#aecb934714ebe5658c857ef1021dd5f2b">00173</a>
<a name="l00174"></a>00174 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_semaphore.html#aecb934714ebe5658c857ef1021dd5f2b" title="Resets a semaphore.">Semaphore::Reset</a>(<a class="code" href="group__types.html#ga090b3bab5602157ebf706a44041dc05e" title="Counter, recommended fastest signed.">cnt_t</a> n) {
<a name="l00175"></a>00175
<a name="l00176"></a>00176 <a class="code" href="group__semaphores.html#ga58e266e609cfd3dbc67f299b3ae9debb" title="Performs a reset operation on the semaphore.">chSemReset</a>(&amp;<a class="code" href="classchibios__rt_1_1_semaphore.html#a604ce05f129534b4b3ad76366f2d90c5" title="Embedded Semaphore structure.">sem</a>, n);
<a name="l00177"></a>00177 }
<a name="l00178"></a><a class="code" href="classchibios__rt_1_1_semaphore.html#abfb1b068e95063f490b27cc3b467f63f">00178</a>
<a name="l00179"></a>00179 <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_semaphore.html#abfb1b068e95063f490b27cc3b467f63f" title="Wait operation on the semaphore.">Semaphore::Wait</a>(<span class="keywordtype">void</span>) {
<a name="l00180"></a>00180
<a name="l00181"></a>00181 <span class="keywordflow">return</span> <a class="code" href="group__semaphores.html#gabc8f7e509870e9b0527a6a68fad71425" title="Performs a wait operation on a semaphore.">chSemWait</a>(&amp;<a class="code" href="classchibios__rt_1_1_semaphore.html#a604ce05f129534b4b3ad76366f2d90c5" title="Embedded Semaphore structure.">sem</a>);
<a name="l00182"></a>00182 }
<a name="l00183"></a><a class="code" href="classchibios__rt_1_1_semaphore.html#a589b4780f60d73929bd77a652b526868">00183</a>
<a name="l00184"></a>00184 <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_semaphore.html#a589b4780f60d73929bd77a652b526868" title="Wait operation on the semaphore with timeout.">Semaphore::WaitTimeout</a>(<a class="code" href="group__types.html#gae3e32a98d431a02106616da3071832dd" title="System Time, recommended fastest unsigned.">systime_t</a> time) {
<a name="l00185"></a>00185
<a name="l00186"></a>00186 <span class="keywordflow">return</span> <a class="code" href="group__semaphores.html#ga0bc227311e5be3e3b6e3aee6a68169da" title="Performs a wait operation on a semaphore with timeout specification.">chSemWaitTimeout</a>(&amp;<a class="code" href="classchibios__rt_1_1_semaphore.html#a604ce05f129534b4b3ad76366f2d90c5" title="Embedded Semaphore structure.">sem</a>, time);
<a name="l00187"></a>00187 }
<a name="l00188"></a><a class="code" href="classchibios__rt_1_1_semaphore.html#a202630db53afefbe5c419ee6d2eddab1">00188</a>
<a name="l00189"></a>00189 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_semaphore.html#a202630db53afefbe5c419ee6d2eddab1" title="Signal operation on the semaphore.">Semaphore::Signal</a>(<span class="keywordtype">void</span>) {
<a name="l00190"></a>00190
<a name="l00191"></a>00191 <a class="code" href="group__semaphores.html#ga7ec0cbda23e49e2370e0b91f20baf05e" title="Performs a signal operation on a semaphore.">chSemSignal</a>(&amp;<a class="code" href="classchibios__rt_1_1_semaphore.html#a604ce05f129534b4b3ad76366f2d90c5" title="Embedded Semaphore structure.">sem</a>);
<a name="l00192"></a>00192 }
<a name="l00193"></a>00193
<a name="l00194"></a><a class="code" href="classchibios__rt_1_1_semaphore.html#a3f2ad5962e43c82fc56b1e0e76a58c9a">00194</a> <span class="preprocessor">#if CH_USE_SEMSW</span>
<a name="l00195"></a>00195 <span class="preprocessor"></span> <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_semaphore.html#a3f2ad5962e43c82fc56b1e0e76a58c9a" title="Atomic signal and wait operations.">Semaphore::SignalWait</a>(<a class="code" href="classchibios__rt_1_1_semaphore.html" title="Class encapsulating a semaphore.">Semaphore</a> *ssem, <a class="code" href="classchibios__rt_1_1_semaphore.html" title="Class encapsulating a semaphore.">Semaphore</a> *wsem) {
<a name="l00196"></a>00196
<a name="l00197"></a>00197 <span class="keywordflow">return</span> <a class="code" href="group__semaphores.html#ga0dc7b4339506de346d67b4560b271e44" title="Performs atomic signal and wait operations on two semaphores.">chSemSignalWait</a>(&amp;ssem-&gt;<a class="code" href="classchibios__rt_1_1_semaphore.html#a604ce05f129534b4b3ad76366f2d90c5" title="Embedded Semaphore structure.">sem</a>, &amp;wsem-&gt;<a class="code" href="classchibios__rt_1_1_semaphore.html#a604ce05f129534b4b3ad76366f2d90c5" title="Embedded Semaphore structure.">sem</a>);
<a name="l00198"></a>00198 }
<a name="l00199"></a>00199 <span class="preprocessor">#endif </span><span class="comment">/* CH_USE_SEMSW */</span>
<a name="l00200"></a>00200 <span class="preprocessor">#endif </span><span class="comment">/* CH_USE_SEMAPHORES */</span>
<a name="l00201"></a>00201
<a name="l00202"></a>00202 <span class="preprocessor">#if CH_USE_MUTEXES</span>
<a name="l00203"></a>00203 <span class="preprocessor"></span> <span class="comment">/*------------------------------------------------------------------------*</span>
<a name="l00204"></a>00204 <span class="comment"> * chibios_rt::Mutex *</span>
<a name="l00205"></a><a class="code" href="classchibios__rt_1_1_mutex.html#a00b2ff557451955a905ecdca2855389b">00205</a> <span class="comment"> *------------------------------------------------------------------------*/</span>
<a name="l00206"></a>00206 <a class="code" href="classchibios__rt_1_1_mutex.html#a00b2ff557451955a905ecdca2855389b" title="Mutex constructor.">Mutex::Mutex</a>(<span class="keywordtype">void</span>) {
<a name="l00207"></a>00207
<a name="l00208"></a>00208 <a class="code" href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6" title="Initializes s Mutex structure.">chMtxInit</a>(&amp;<a class="code" href="classchibios__rt_1_1_mutex.html#a6fe411dfe88642cc7c379a59ea931da2" title="Embedded Mutex structure.">mutex</a>);
<a name="l00209"></a>00209 }
<a name="l00210"></a><a class="code" href="classchibios__rt_1_1_mutex.html#a787ecfd207fd25760a3c07517b69c148">00210</a>
<a name="l00211"></a>00211 <span class="keywordtype">bool</span> <a class="code" href="classchibios__rt_1_1_mutex.html#a787ecfd207fd25760a3c07517b69c148" title="Tries a lock operation on the mutex.">Mutex::TryLock</a>(<span class="keywordtype">void</span>) {
<a name="l00212"></a>00212
<a name="l00213"></a>00213 <span class="keywordflow">return</span> <a class="code" href="group__mutexes.html#gaada14e216460dc55e1816234168cf95c" title="Tries to lock a mutex.">chMtxTryLock</a>(&amp;<a class="code" href="classchibios__rt_1_1_mutex.html#a6fe411dfe88642cc7c379a59ea931da2" title="Embedded Mutex structure.">mutex</a>);
<a name="l00214"></a>00214 }
<a name="l00215"></a><a class="code" href="classchibios__rt_1_1_mutex.html#a1726d7244983f7be74fcfa9cfb63745f">00215</a>
<a name="l00216"></a>00216 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_mutex.html#a1726d7244983f7be74fcfa9cfb63745f" title="Locks the mutex.">Mutex::Lock</a>(<span class="keywordtype">void</span>) {
<a name="l00217"></a>00217
<a name="l00218"></a>00218 <a class="code" href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba" title="Locks the specified mutex.">chMtxLock</a>(&amp;<a class="code" href="classchibios__rt_1_1_mutex.html#a6fe411dfe88642cc7c379a59ea931da2" title="Embedded Mutex structure.">mutex</a>);
<a name="l00219"></a>00219 }
<a name="l00220"></a><a class="code" href="classchibios__rt_1_1_mutex.html#a03150e8fa423f7e042661d350d238b84">00220</a>
<a name="l00221"></a>00221 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_mutex.html#a03150e8fa423f7e042661d350d238b84" title="Unlocks the mutex.">Mutex::Unlock</a>(<span class="keywordtype">void</span>) {
<a name="l00222"></a>00222
<a name="l00223"></a>00223 <a class="code" href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669" title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<a name="l00224"></a>00224 }
<a name="l00225"></a>00225
<a name="l00226"></a>00226 <span class="keywordtype">void</span> UnlockAll(<span class="keywordtype">void</span>) {
<a name="l00227"></a>00227
<a name="l00228"></a>00228 <a class="code" href="group__mutexes.html#ga853b4ced43d22fb5d82678dd2f0aba75" title="Unlocks all the mutexes owned by the invoking thread.">chMtxUnlockAll</a>();
<a name="l00229"></a>00229 }
<a name="l00230"></a>00230
<a name="l00231"></a>00231 <span class="preprocessor">#if CH_USE_CONDVARS</span>
<a name="l00232"></a>00232 <span class="preprocessor"></span> <span class="comment">/*------------------------------------------------------------------------*</span>
<a name="l00233"></a>00233 <span class="comment"> * chibios_rt::CondVar *</span>
<a name="l00234"></a><a class="code" href="classchibios__rt_1_1_cond_var.html#a1b9e183dd1c97f1a0104f57f47197ecc">00234</a> <span class="comment"> *------------------------------------------------------------------------*/</span>
<a name="l00235"></a>00235 <a class="code" href="classchibios__rt_1_1_cond_var.html#a1b9e183dd1c97f1a0104f57f47197ecc" title="CondVar constructor.">CondVar::CondVar</a>(<span class="keywordtype">void</span>) {
<a name="l00236"></a>00236
<a name="l00237"></a>00237 <a class="code" href="group__condvars.html#ga4c698ba6ce06089c08f989e126af9873" title="Initializes s CondVar structure.">chCondInit</a>(&amp;<a class="code" href="classchibios__rt_1_1_cond_var.html#a726124b6782ea9e073d6be739ad75f53" title="Embedded CondVar structure.">condvar</a>);
<a name="l00238"></a>00238 }
<a name="l00239"></a><a class="code" href="classchibios__rt_1_1_cond_var.html#a075c5724485b6f47bdf6f1f003154f02">00239</a>
<a name="l00240"></a>00240 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_cond_var.html#a075c5724485b6f47bdf6f1f003154f02" title="Signals the CondVar.">CondVar::Signal</a>(<span class="keywordtype">void</span>) {
<a name="l00241"></a>00241
<a name="l00242"></a>00242 <a class="code" href="group__condvars.html#gadddadb68e2a2ce061c7df0d647da9996" title="Signals one thread that is waiting on the condition variable.">chCondSignal</a>(&amp;<a class="code" href="classchibios__rt_1_1_cond_var.html#a726124b6782ea9e073d6be739ad75f53" title="Embedded CondVar structure.">condvar</a>);
<a name="l00243"></a>00243 }
<a name="l00244"></a><a class="code" href="classchibios__rt_1_1_cond_var.html#a0111c4947178c9ef6b15e03f24d2e861">00244</a>
<a name="l00245"></a>00245 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_cond_var.html#a0111c4947178c9ef6b15e03f24d2e861" title="Broadcasts the CondVar.">CondVar::Broadcast</a>(<span class="keywordtype">void</span>) {
<a name="l00246"></a>00246
<a name="l00247"></a>00247 <a class="code" href="group__condvars.html#ga60c24a8060a884313efe82b8404e77f6" title="Signals all threads that are waiting on the condition variable.">chCondBroadcast</a>(&amp;<a class="code" href="classchibios__rt_1_1_cond_var.html#a726124b6782ea9e073d6be739ad75f53" title="Embedded CondVar structure.">condvar</a>);
<a name="l00248"></a>00248 }
<a name="l00249"></a><a class="code" href="classchibios__rt_1_1_cond_var.html#a37e0b0cb4ac5cbe6bbb56c51539284c8">00249</a>
<a name="l00250"></a>00250 <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_cond_var.html#a37e0b0cb4ac5cbe6bbb56c51539284c8" title="Waits on the CondVar while releasing the controlling mutex.">CondVar::Wait</a>(<span class="keywordtype">void</span>) {
<a name="l00251"></a>00251
<a name="l00252"></a>00252 <span class="keywordflow">return</span> <a class="code" href="group__condvars.html#ga466f912bc9b09b133fae862993004ffe" title="Waits on the condition variable releasing the mutex lock.">chCondWait</a>(&amp;<a class="code" href="classchibios__rt_1_1_cond_var.html#a726124b6782ea9e073d6be739ad75f53" title="Embedded CondVar structure.">condvar</a>);
<a name="l00253"></a>00253 }
<a name="l00254"></a>00254
<a name="l00255"></a><a class="code" href="classchibios__rt_1_1_cond_var.html#a866a352fb3bc95f07abda728d4ae4906">00255</a> <span class="preprocessor">#if CH_USE_CONDVARS_TIMEOUT</span>
<a name="l00256"></a>00256 <span class="preprocessor"></span> <a class="code" href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3" title="Message, use signed pointer equivalent.">msg_t</a> <a class="code" href="classchibios__rt_1_1_cond_var.html#a866a352fb3bc95f07abda728d4ae4906" title="Waits on the CondVar while releasing the controlling mutex.">CondVar::WaitTimeout</a>(<a class="code" href="group__types.html#gae3e32a98d431a02106616da3071832dd" title="System Time, recommended fastest unsigned.">systime_t</a> time) {
<a name="l00257"></a>00257
<a name="l00258"></a>00258 <span class="keywordflow">return</span> <a class="code" href="group__condvars.html#ga07a0c55ac1002a64e8c7f9b7e3ca1caf" title="Waits on the condition variable releasing the mutex lock.">chCondWaitTimeout</a>(&amp;<a class="code" href="classchibios__rt_1_1_cond_var.html#a726124b6782ea9e073d6be739ad75f53" title="Embedded CondVar structure.">condvar</a>, time);
<a name="l00259"></a>00259 }
<a name="l00260"></a>00260 <span class="preprocessor">#endif </span><span class="comment">/* CH_USE_CONDVARS_TIMEOUT */</span>
<a name="l00261"></a>00261 <span class="preprocessor">#endif </span><span class="comment">/* CH_USE_CONDVARS */</span>
<a name="l00262"></a>00262 <span class="preprocessor">#endif </span><span class="comment">/* CH_USE_MUTEXES */</span>
<a name="l00263"></a>00263
<a name="l00264"></a>00264 <span class="preprocessor">#if CH_USE_EVENTS</span>
<a name="l00265"></a>00265 <span class="preprocessor"></span> <span class="comment">/*------------------------------------------------------------------------*</span>
<a name="l00266"></a>00266 <span class="comment"> * chibios_rt::Event *</span>
<a name="l00267"></a><a class="code" href="classchibios__rt_1_1_event.html#a4fad1d076cd31e2add80447f7980d8d2">00267</a> <span class="comment"> *------------------------------------------------------------------------*/</span>
<a name="l00268"></a>00268 <a class="code" href="classchibios__rt_1_1_event.html#a4fad1d076cd31e2add80447f7980d8d2" title="Event constructor.">Event::Event</a>(<span class="keywordtype">void</span>) {
<a name="l00269"></a>00269
<a name="l00270"></a>00270 <a class="code" href="group__events.html#gab8d0fdc09be629dfb438c32a0523db42" title="Initializes an Event Source.">chEvtInit</a>(&amp;<a class="code" href="classchibios__rt_1_1_event.html#a39ab1be709273f81cd1f9318abfe1508" title="Embedded EventSource structure.">event</a>);
<a name="l00271"></a>00271 }
<a name="l00272"></a><a class="code" href="classchibios__rt_1_1_event.html#a871e59df8f46225845806ebdec4e832c">00272</a>
<a name="l00273"></a>00273 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_event.html#a871e59df8f46225845806ebdec4e832c" title="Registers a listener on the event source.">Event::Register</a>(<a class="code" href="struct_event_listener.html" title="Event Listener structure.">EventListener</a> *elp, <a class="code" href="group__types.html#gada5ed33935b8347e213aeb76582642e7" title="Event Id, use fastest signed.">eventid_t</a> eid) {
<a name="l00274"></a>00274
<a name="l00275"></a>00275 <a class="code" href="group__events.html#gad478062f3e09d00e1ad8ebe65a06ec0c" title="Registers an Event Listener on an Event Source.">chEvtRegister</a>(&amp;<a class="code" href="classchibios__rt_1_1_event.html#a39ab1be709273f81cd1f9318abfe1508" title="Embedded EventSource structure.">event</a>,elp, eid);
<a name="l00276"></a>00276 }
<a name="l00277"></a><a class="code" href="classchibios__rt_1_1_event.html#a39acaf2436f139a798973308c1929031">00277</a>
<a name="l00278"></a>00278 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_event.html#a39acaf2436f139a798973308c1929031" title="Registers an Event Listener on an Event Source.">Event::RegisterMask</a>(<a class="code" href="struct_event_listener.html" title="Event Listener structure.">EventListener</a> *elp, <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> emask) {
<a name="l00279"></a>00279
<a name="l00280"></a>00280 <a class="code" href="group__events.html#ga4002600fe552128aaf96a6a1d3ada3ee" title="Registers an Event Listener on an Event Source.">chEvtRegisterMask</a>(&amp;<a class="code" href="classchibios__rt_1_1_event.html#a39ab1be709273f81cd1f9318abfe1508" title="Embedded EventSource structure.">event</a>,elp, emask);
<a name="l00281"></a>00281 }
<a name="l00282"></a><a class="code" href="classchibios__rt_1_1_event.html#a177bc72df220068c9d620b8e9f42f2f5">00282</a>
<a name="l00283"></a>00283 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_event.html#a177bc72df220068c9d620b8e9f42f2f5" title="Unregisters a listener.">Event::Unregister</a>(<a class="code" href="struct_event_listener.html" title="Event Listener structure.">EventListener</a> *elp) {
<a name="l00284"></a>00284
<a name="l00285"></a>00285 <a class="code" href="group__events.html#ga68d15e1c7e12e96edd40069a27981d38" title="Unregisters an Event Listener from its Event Source.">chEvtUnregister</a>(&amp;<a class="code" href="classchibios__rt_1_1_event.html#a39ab1be709273f81cd1f9318abfe1508" title="Embedded EventSource structure.">event</a>, elp);
<a name="l00286"></a>00286 }
<a name="l00287"></a><a class="code" href="classchibios__rt_1_1_event.html#a665b23d0d212b06107a27f118021238c">00287</a>
<a name="l00288"></a>00288 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_event.html#a665b23d0d212b06107a27f118021238c" title="Broadcasts an event.">Event::Broadcast</a>(<span class="keywordtype">void</span>) {
<a name="l00289"></a>00289
<a name="l00290"></a>00290 <a class="code" href="group__events.html#ga44015af4dd20f74b0f73824ff1c1b2f4" title="Signals all the Event Listeners registered on the specified Event Source.">chEvtBroadcast</a>(&amp;<a class="code" href="classchibios__rt_1_1_event.html#a39ab1be709273f81cd1f9318abfe1508" title="Embedded EventSource structure.">event</a>);
<a name="l00291"></a>00291 }
<a name="l00292"></a><a class="code" href="classchibios__rt_1_1_event.html#ae3c7092d78ac9dda43c109b356826f41">00292</a>
<a name="l00293"></a>00293 <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> <a class="code" href="classchibios__rt_1_1_event.html#ae3c7092d78ac9dda43c109b356826f41" title="Clears specified events from the pending events mask.">Event::Clear</a>(<a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> mask) {
<a name="l00294"></a>00294
<a name="l00295"></a>00295 <span class="keywordflow">return</span> <a class="code" href="group__events.html#ga76f41b9668c3f1adafc516a8f92b9cad" title="Clears the pending events specified in the mask.">chEvtClear</a>(mask);
<a name="l00296"></a>00296 }
<a name="l00297"></a><a class="code" href="classchibios__rt_1_1_event.html#aca48258fbffb54c6e19bbb9016c4cee1">00297</a>
<a name="l00298"></a>00298 <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> <a class="code" href="classchibios__rt_1_1_event.html#aca48258fbffb54c6e19bbb9016c4cee1" title="Makes an events mask pending in the current thread.">Event::Pend</a>(<a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> mask) {
<a name="l00299"></a>00299
<a name="l00300"></a>00300 <span class="keywordflow">return</span> <a class="code" href="group__events.html#ga94f14b6063f42b9be79a7dabde18232d" title="Pends a set of event flags on the current thread, this is much faster than using...">chEvtPend</a>(mask);
<a name="l00301"></a>00301 }
<a name="l00302"></a><a class="code" href="classchibios__rt_1_1_event.html#afde2cfb76dbd552ebb05bc6c6c8b2969">00302</a>
<a name="l00303"></a>00303 <span class="keywordtype">void</span> <a class="code" href="classchibios__rt_1_1_event.html#afde2cfb76dbd552ebb05bc6c6c8b2969" title="Invokes the event handlers associated with a mask.">Event::Dispatch</a>(<span class="keyword">const</span> <a class="code" href="group__events.html#ga1a153010620569dd0cac24da8952269f" title="Event Handler callback function.">evhandler_t</a> handlers[], <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> mask) {
<a name="l00304"></a>00304
<a name="l00305"></a>00305 <a class="code" href="group__events.html#gaba2061f315848a8a722efcae258edc8c" title="Invokes the event handlers associated to an event flags mask.">chEvtDispatch</a>(handlers, mask);
<a name="l00306"></a>00306 }
<a name="l00307"></a><a class="code" href="classchibios__rt_1_1_event.html#a5853ef97699efe31a969c7fc200e09a1">00307</a>
<a name="l00308"></a>00308 <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> <a class="code" href="classchibios__rt_1_1_event.html#a5853ef97699efe31a969c7fc200e09a1" title="Waits for a single event.">Event::WaitOne</a>(<a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> ewmask) {
<a name="l00309"></a>00309
<a name="l00310"></a>00310 <span class="keywordflow">return</span> <a class="code" href="group__events.html#ga77651e22578713ebe355c1213286c2e9" title="Waits for exactly one of the specified events.">chEvtWaitOne</a>(ewmask);
<a name="l00311"></a>00311 }
<a name="l00312"></a><a class="code" href="classchibios__rt_1_1_event.html#aeb53e2435cf8f614ea51e3c90334d5ae">00312</a>
<a name="l00313"></a>00313 <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> <a class="code" href="classchibios__rt_1_1_event.html#aeb53e2435cf8f614ea51e3c90334d5ae" title="Waits for any of the specified events.">Event::WaitAny</a>(<a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> ewmask) {
<a name="l00314"></a>00314
<a name="l00315"></a>00315 <span class="keywordflow">return</span> <a class="code" href="group__events.html#gabd731d3ed2f037b2409e370676575f8d" title="Waits for any of the specified events.">chEvtWaitAny</a>(ewmask);
<a name="l00316"></a>00316 }
<a name="l00317"></a><a class="code" href="classchibios__rt_1_1_event.html#a55bd3220048e77217f5f75af7697d46f">00317</a>
<a name="l00318"></a>00318 <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> <a class="code" href="classchibios__rt_1_1_event.html#a55bd3220048e77217f5f75af7697d46f" title="Waits for all the specified event flags then clears them.">Event::WaitAll</a>(<a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> ewmask) {
<a name="l00319"></a>00319
<a name="l00320"></a>00320 <span class="keywordflow">return</span> <a class="code" href="group__events.html#ga8c5c6bf310a08cdc836d23f98a87dbf5" title="Waits for all the specified events.">chEvtWaitAll</a>(ewmask);
<a name="l00321"></a>00321 }
<a name="l00322"></a>00322
<a name="l00323"></a><a class="code" href="classchibios__rt_1_1_event.html#ab8fc502561437fec0194653052202b82">00323</a> <span class="preprocessor">#if CH_USE_EVENTS_TIMEOUT</span>
<a name="l00324"></a>00324 <span class="preprocessor"></span> <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> <a class="code" href="classchibios__rt_1_1_event.html#ab8fc502561437fec0194653052202b82" title="Waits for a single event.">Event::WaitOneTimeout</a>(<a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> ewmask, <a class="code" href="group__types.html#gae3e32a98d431a02106616da3071832dd" title="System Time, recommended fastest unsigned.">systime_t</a> time) {
<a name="l00325"></a>00325
<a name="l00326"></a>00326 <span class="keywordflow">return</span> <a class="code" href="group__events.html#ga2944a7fc82e7cc15537f5a7c04f457d3" title="Waits for exactly one of the specified events.">chEvtWaitOneTimeout</a>(ewmask, time);
<a name="l00327"></a>00327 }
<a name="l00328"></a><a class="code" href="classchibios__rt_1_1_event.html#a4870dfce1f2ace0ab434718b0960b960">00328</a>
<a name="l00329"></a>00329 <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> <a class="code" href="classchibios__rt_1_1_event.html#a4870dfce1f2ace0ab434718b0960b960" title="Waits for any of the specified events.">Event::WaitAnyTimeout</a>(<a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> ewmask, <a class="code" href="group__types.html#gae3e32a98d431a02106616da3071832dd" title="System Time, recommended fastest unsigned.">systime_t</a> time) {
<a name="l00330"></a>00330
<a name="l00331"></a>00331 <span class="keywordflow">return</span> <a class="code" href="group__events.html#gaf690406ccc833e2c9235e7e2041a6715" title="Waits for any of the specified events.">chEvtWaitAnyTimeout</a>(ewmask, time);
<a name="l00332"></a>00332 }
<a name="l00333"></a><a class="code" href="classchibios__rt_1_1_event.html#ab8c805f6b615e47050a75b16fd94492d">00333</a>
<a name="l00334"></a>00334 <a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> <a class="code" href="classchibios__rt_1_1_event.html#ab8c805f6b615e47050a75b16fd94492d" title="Waits for all the specified event flags then clears them.">Event::WaitAllTimeout</a>(<a class="code" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708" title="Event Mask, recommended fastest unsigned.">eventmask_t</a> ewmask, <a class="code" href="group__types.html#gae3e32a98d431a02106616da3071832dd" title="System Time, recommended fastest unsigned.">systime_t</a> time) {
<a name="l00335"></a>00335
<a name="l00336"></a>00336 <span class="keywordflow">return</span> <a class="code" href="group__events.html#ga90d702300eecee3d05f83e95b155c3ee" title="Waits for all the specified events.">chEvtWaitAllTimeout</a>(ewmask, time);
<a name="l00337"></a>00337 }
<a name="l00338"></a>00338 <span class="preprocessor">#endif </span><span class="comment">/* CH_USE_EVENTS_TIMEOUT */</span>
<a name="l00339"></a>00339 <span class="preprocessor">#endif </span><span class="comment">/* CH_USE_EVENTS */</span>
<a name="l00340"></a>00340 }
<a name="l00341"></a>00341 <span class="comment"></span>
<a name="l00342"></a>00342 <span class="comment">/** @} */</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Jul 11 13:13:00 2010 for ChibiOS/RT by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.6.3</small></address>
</body>
</html>