1 | /* Send_messages |
---|
2 | * |
---|
3 | * This routine sends a series of 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.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #ifdef HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include "system.h" |
---|
23 | |
---|
24 | void Send_messages() |
---|
25 | { |
---|
26 | rtems_status_code status; |
---|
27 | uint32_t broadcast_count; |
---|
28 | |
---|
29 | puts_nocr( "rtems_message_queue_send: " ); |
---|
30 | puts( buffer1 ); |
---|
31 | |
---|
32 | status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer1, 16 ); |
---|
33 | directive_failed( status, "rtems_message_queue_send" ); |
---|
34 | |
---|
35 | puts( "Delaying for a second" ); |
---|
36 | status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); |
---|
37 | directive_failed( status, "rtems_task_wake_after" ); |
---|
38 | |
---|
39 | puts_nocr( "rtems_message_queue_urgent: " ); |
---|
40 | puts( buffer2 ); |
---|
41 | status = rtems_message_queue_urgent( Queue_id[ 1 ], (long (*)[4])buffer2, 16 ); |
---|
42 | directive_failed( status, "rtems_message_queue_urgent" ); |
---|
43 | |
---|
44 | puts( "Delaying for a second" ); |
---|
45 | status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); |
---|
46 | directive_failed( status, "rtems_task_wake_after" ); |
---|
47 | |
---|
48 | puts_nocr( "rtems_message_queue_broadcast: " ); |
---|
49 | puts( buffer3 ); |
---|
50 | status = rtems_message_queue_broadcast( |
---|
51 | Queue_id[ 1 ], |
---|
52 | (long (*)[4])buffer3, |
---|
53 | 16, |
---|
54 | &broadcast_count |
---|
55 | ); |
---|
56 | directive_failed( status, "rtems_message_queue_broadcast" ); |
---|
57 | |
---|
58 | puts( "Delaying for a second" ); |
---|
59 | status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); |
---|
60 | directive_failed( status, "rtems_task_wake_after" ); |
---|
61 | } |
---|