<ahref="testmsg_8c.html">Go to the documentation of this file.</a><divclass="fragment"><preclass="fragment"><aname="l00001"></a>00001 <spanclass="comment">/*</span>
<aname="l00027"></a>00027 <spanclass="preprocessor">#include "<aclass="code"href="ch_8h.html"title="ChibiOS/RT main include file.">ch.h</a>"</span>
<aname="l00028"></a>00028 <spanclass="preprocessor">#include "<aclass="code"href="test_8h.html"title="Tests support header.">test.h</a>"</span>
<aname="l00074"></a>00074 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread(<spanclass="keywordtype">void</span> *p) {
<aname="l00075"></a>00075
<aname="l00076"></a>00076 <aclass="code"href="group__messages.html#ga29a48a438e97dc47cb798a84e13764cb"title="Sends a message to the specified thread.">chMsgSend</a>(p, <spanclass="charliteral">'A'</span>);
<aname="l00077"></a>00077 <aclass="code"href="group__messages.html#ga29a48a438e97dc47cb798a84e13764cb"title="Sends a message to the specified thread.">chMsgSend</a>(p, <spanclass="charliteral">'B'</span>);
<aname="l00078"></a>00078 <aclass="code"href="group__messages.html#ga29a48a438e97dc47cb798a84e13764cb"title="Sends a message to the specified thread.">chMsgSend</a>(p, <spanclass="charliteral">'C'</span>);
<aname="l00079"></a>00079 <aclass="code"href="group__messages.html#ga29a48a438e97dc47cb798a84e13764cb"title="Sends a message to the specified thread.">chMsgSend</a>(p, <spanclass="charliteral">'D'</span>);
<aname="l00084"></a>00084 <aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> msg;
<aname="l00089"></a>00089 threads[0] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[0], WA_SIZE, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() + 1,
<aname="l00090"></a>00090 thread, <aclass="code"href="group__threads.html#gaa36662628234799d205ff8c0cc6745c5"title="Returns a pointer to the current Thread.">chThdSelf</a>());
<aname="l00091"></a>00091 <aclass="code"href="group__messages.html#ga19a54b3b4b0e3677c47d650a3be3c7aa"title="Releases the thread waiting on top of the messages queue.">chMsgRelease</a>(msg = <aclass="code"href="group__messages.html#gae68fefbf9d0404bbf56ae354961fae41"title="Suspends the thread and waits for an incoming message.">chMsgWait</a>());
<aname="l00092"></a>00092 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(msg);
<aname="l00093"></a>00093 <aclass="code"href="group__messages.html#ga19a54b3b4b0e3677c47d650a3be3c7aa"title="Releases the thread waiting on top of the messages queue.">chMsgRelease</a>(msg = <aclass="code"href="group__messages.html#gae68fefbf9d0404bbf56ae354961fae41"title="Suspends the thread and waits for an incoming message.">chMsgWait</a>());
<aname="l00094"></a>00094 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(msg);
<aname="l00095"></a>00095 <aclass="code"href="group__messages.html#ga19a54b3b4b0e3677c47d650a3be3c7aa"title="Releases the thread waiting on top of the messages queue.">chMsgRelease</a>(msg = <aclass="code"href="group__messages.html#gae68fefbf9d0404bbf56ae354961fae41"title="Suspends the thread and waits for an incoming message.">chMsgWait</a>());
<aname="l00096"></a>00096 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(msg);
<aname="l00104"></a>00104 msg = <aclass="code"href="group__messages.html#ga65dda189b03b238412301ce5d80bfcf4"title="Returns the next message in the queue.">chMsgGet</a>();
<aname="l00106"></a>00106 <aclass="code"href="group__messages.html#ga19a54b3b4b0e3677c47d650a3be3c7aa"title="Releases the thread waiting on top of the messages queue.">chMsgRelease</a>(0);
<aname="l00112"></a>00112 msg = <aclass="code"href="group__messages.html#ga65dda189b03b238412301ce5d80bfcf4"title="Returns the next message in the queue.">chMsgGet</a>();
<aname="l00116"></a>00116 <spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> testmsg1 = {
<aname="l00128"></a><aclass="code"href="testmsg_8h.html#a77709c017f100b2d6179ace41b9aba67">00128</a><spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> * <spanclass="keyword">const</span><aclass="code"href="testmsg_8c.html#ac111c8b66901d381cd6073425d269b1c"title="Test sequence for messages.">patternmsg</a>[] = {
Generated on Sun Nov 28 2010 14:09:49 for ChibiOS/RT by <ahref="http://www.doxygen.org/index.html"><imgsrc="doxygen.png"alt="doxygen"align="middle"border="0"></a> 1.7.1</small></address>