1 | /* Task_1_through_3 |
---|
2 | * |
---|
3 | * This task is a cyclic version of test1 to asssure that the times |
---|
4 | * displayed are not skewed as in test1. "TA1" is printed once every |
---|
5 | * 5 seconds, "TA2" is printed once every 10 seconds, and "TA3" is |
---|
6 | * printed once every 15 seconds. The times displayed should be |
---|
7 | * in multiples of 5, 10, and 15 for TA1, TA2, and TA3 respectively. |
---|
8 | * If the times are skewed from these values, then the calendar time |
---|
9 | * does not correspond correctly with the number of ticks. |
---|
10 | * |
---|
11 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
12 | * On-Line Applications Research Corporation (OAR). |
---|
13 | * All rights assigned to U.S. Government, 1994. |
---|
14 | * |
---|
15 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
16 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
17 | * notice must appear in all copies of this file and its derivatives. |
---|
18 | * |
---|
19 | * $Id$ |
---|
20 | */ |
---|
21 | |
---|
22 | #include "system.h" |
---|
23 | |
---|
24 | rtems_task Task_1_through_3( |
---|
25 | rtems_task_argument argument |
---|
26 | ) |
---|
27 | { |
---|
28 | rtems_id tid; |
---|
29 | rtems_time_of_day time; |
---|
30 | rtems_status_code status; |
---|
31 | |
---|
32 | status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); |
---|
33 | directive_failed( status, "rtems_task_ident of self" ); |
---|
34 | |
---|
35 | while ( FOREVER ) { |
---|
36 | status = rtems_timer_fire_after( |
---|
37 | Timer_id[ argument ], |
---|
38 | task_number( tid ) * 5 * TICKS_PER_SECOND, |
---|
39 | Resume_task, |
---|
40 | NULL |
---|
41 | ); |
---|
42 | directive_failed( status, "tm_fire_after failed" ); |
---|
43 | |
---|
44 | status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); |
---|
45 | directive_failed( status, "rtems_clock_get failed" ); |
---|
46 | |
---|
47 | if ( time.second >= 35 ) { |
---|
48 | puts( "*** END OF TEST 24 ***" ); |
---|
49 | exit( 0 ); |
---|
50 | } |
---|
51 | |
---|
52 | put_name( Task_name[ task_number( tid ) ], FALSE ); |
---|
53 | print_time( " - rtems_clock_get - ", &time, "\n" ); |
---|
54 | |
---|
55 | status = rtems_task_suspend( RTEMS_SELF ); |
---|
56 | directive_failed( status, "rtems_task_suspend" ); |
---|
57 | } |
---|
58 | } |
---|