1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/examples/ipc_pingpong
2014-05-14 14:46:08 +02:00
..
main.c examples: make includes adhere to coding conventions 2014-03-24 11:08:42 +01:00
Makefile repace project by application in documentation 2014-02-18 12:28:32 +01:00
README.md examples: added README.md to ipc_pingpong example 2014-05-14 14:46:08 +02:00

IPC Pingpong!

This example is to illustrate the usage of RIOTs IPC messaging system.

The application starts a second thread (in addition to the main thread) and sends messages between these two threads. The main thread call thread_send_receive() in an endless loop. The second thread receives the message, prints 2nd: got msg from x to stdout and sends a reply message with an incrementing number back to the main thread.

The correct output should look like this:

kernel_init(): This is RIOT! (Version: xxx)
kernel_init(): jumping into first task...
Hello world!
second_thread starting.
2nd: got msg from 1
Got msg with content 2
2nd: got msg from 1
Got msg with content 3
2nd: got msg from 1
Got msg with content 4
2nd: got msg from 1
Got msg with content 5
2nd: got msg from 1
Got msg with content 6
2nd: got msg from 1
Got msg with content 7
2nd: got msg from 1
Got msg with content 8
2nd: got msg from 1
Got msg with content 9
2nd: got msg from 1
Got msg with content 10
2nd: got msg from 1
[...]