1 | /* Task_1_through_3 |
---|
2 | * |
---|
3 | * This routine serves as a test task. It verifies the basic task |
---|
4 | * switching capabilities of the executive. |
---|
5 | * |
---|
6 | * Input parameters: |
---|
7 | * argument - task argument |
---|
8 | * |
---|
9 | * Output parameters: NONE |
---|
10 | * |
---|
11 | * COPYRIGHT (c) 1989-1999. |
---|
12 | * On-Line Applications Research Corporation (OAR). |
---|
13 | * |
---|
14 | * The license and distribution terms for this file may be |
---|
15 | * found in the file LICENSE in this distribution or at |
---|
16 | * http://www.rtems.com/license/LICENSE. |
---|
17 | * |
---|
18 | * $Id$ |
---|
19 | */ |
---|
20 | |
---|
21 | #include "system.h" |
---|
22 | |
---|
23 | rtems_task Task_1_through_3( |
---|
24 | rtems_task_argument argument |
---|
25 | ) |
---|
26 | { |
---|
27 | rtems_id tid; |
---|
28 | rtems_time_of_day time; |
---|
29 | rtems_status_code status; |
---|
30 | rtems_interval ticks; |
---|
31 | |
---|
32 | status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); |
---|
33 | directive_failed( status, "rtems_task_ident" ); |
---|
34 | |
---|
35 | /* |
---|
36 | * Use TOD_MILLISECONDS_TO_TICKS not RTEMS_MILLISECONDS_TO_TICKS to |
---|
37 | * test C implementation in SuperCore -- not macro version used |
---|
38 | * everywhere else. |
---|
39 | */ |
---|
40 | ticks = TOD_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 ); |
---|
41 | |
---|
42 | while( FOREVER ) { |
---|
43 | status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); |
---|
44 | directive_failed( status, "rtems_clock_get" ); |
---|
45 | |
---|
46 | if ( time.second >= 35 ) { |
---|
47 | puts( "*** END OF TEST 1 ***" ); |
---|
48 | rtems_test_exit( 0 ); |
---|
49 | } |
---|
50 | |
---|
51 | put_name( Task_name[ task_number( tid ) ], FALSE ); |
---|
52 | print_time( " - rtems_clock_get - ", &time, "\n" ); |
---|
53 | |
---|
54 | status = rtems_task_wake_after( ticks ); |
---|
55 | directive_failed( status, "rtems_task_wake_after" ); |
---|
56 | } |
---|
57 | } |
---|