4.104.114.84.95
Line | |
---|
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-1998. |
---|
12 | * On-Line Applications Research Corporation (OAR). |
---|
13 | * Copyright assigned to U.S. Government, 1994. |
---|
14 | * |
---|
15 | * The license and distribution terms for this file may be |
---|
16 | * found in the file LICENSE in this distribution or at |
---|
17 | * http://www.OARcorp.com/rtems/license.html. |
---|
18 | * |
---|
19 | * $Id$ |
---|
20 | */ |
---|
21 | |
---|
22 | #include "system.h" |
---|
23 | |
---|
24 | void Task_2_through_4() |
---|
25 | { |
---|
26 | ID tid; |
---|
27 | int tid_index; |
---|
28 | rtems_time_of_day time; |
---|
29 | ER status; |
---|
30 | char name[30]; |
---|
31 | |
---|
32 | status = get_tid( &tid ); |
---|
33 | directive_failed( status, "get_tid"); |
---|
34 | |
---|
35 | tid_index = tid - 1; /* account for init tasks */ |
---|
36 | |
---|
37 | sprintf(name, "TA%d", tid_index); |
---|
38 | |
---|
39 | while( FOREVER ) { |
---|
40 | status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); |
---|
41 | directive_failed( status, "rtems_clock_get" ); |
---|
42 | |
---|
43 | if ( time.second >= 35 ) { |
---|
44 | puts( "*** END OF ITRON TEST 3 ***" ); |
---|
45 | exit( 0 ); |
---|
46 | } |
---|
47 | |
---|
48 | printf(name); |
---|
49 | print_time( " - rtems_clock_get - ", &time, "\n" ); |
---|
50 | |
---|
51 | status = rtems_task_wake_after( tid_index * 5 * TICKS_PER_SECOND ); |
---|
52 | directive_failed( status, "rtems_task_wake_after" ); |
---|
53 | } |
---|
54 | } |
---|
55 | |
---|
Note: See
TracBrowser
for help on using the repository browser.