4.104.115
Last change
on this file since 39615f4 was
9992cac,
checked in by Joel Sherrill <joel.sherrill@…>, on 08/12/09 at 20:50:29
|
2009-08-12 Joel Sherrill <joel.sherrill@…>
- mp01/task1.c, mp02/task1.c, mp03/task1.c, mp05/task1.c, mp06/task1.c,
mp07/task1.c, mp08/task1.c, mp09/recvmsg.c, mp09/sendmsg.c,
mp09/task1.c, mp10/init.c, mp12/init.c, mp13/init.c, mp13/task1.c,
mp13/task2.c, mp14/evtask1.c, mp14/init.c: Eliminate test routines
TICKS_PER_SECOND and get_ticks_per_second() in favor of new
rtems_clock_get_ticks_per_second().
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /* Receive_messages |
---|
2 | * |
---|
3 | * This routine receives and prints three messages. |
---|
4 | * an error condition. |
---|
5 | * |
---|
6 | * Input parameters: NONE |
---|
7 | * |
---|
8 | * Output parameters: NONE |
---|
9 | * |
---|
10 | * COPYRIGHT (c) 1989-2009. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.com/license/LICENSE. |
---|
16 | * |
---|
17 | * $Id$ |
---|
18 | */ |
---|
19 | |
---|
20 | #include "system.h" |
---|
21 | |
---|
22 | void Receive_messages() |
---|
23 | { |
---|
24 | rtems_status_code status; |
---|
25 | uint32_t index; |
---|
26 | size_t size; |
---|
27 | char receive_buffer[16]; |
---|
28 | |
---|
29 | for ( index=1 ; index <=3 ; index++ ) { |
---|
30 | puts( "Receiving message ..." ); |
---|
31 | status = rtems_message_queue_receive( |
---|
32 | Queue_id[ 1 ], |
---|
33 | receive_buffer, |
---|
34 | &size, |
---|
35 | RTEMS_DEFAULT_OPTIONS, |
---|
36 | RTEMS_NO_TIMEOUT |
---|
37 | ); |
---|
38 | directive_failed( status, "rtems_message_queue_receive" ); |
---|
39 | puts_nocr( "Received : "); |
---|
40 | puts( receive_buffer ); |
---|
41 | } |
---|
42 | |
---|
43 | puts( "Receiver delaying for a second" ); |
---|
44 | status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); |
---|
45 | directive_failed( status, "rtems_task_wake_after" ); |
---|
46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.