1 | /* Init |
---|
2 | * |
---|
3 | * This routine is the XXX. |
---|
4 | * |
---|
5 | * Input parameters: |
---|
6 | * argument - task argument |
---|
7 | * |
---|
8 | * Output parameters: NONE |
---|
9 | * |
---|
10 | * COPYRIGHT (c) 2008. |
---|
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 | #define CONFIGURE_INIT |
---|
21 | #include "system.h" |
---|
22 | |
---|
23 | rtems_task Init( |
---|
24 | rtems_task_argument argument |
---|
25 | ) |
---|
26 | { |
---|
27 | rtems_time_of_day time; |
---|
28 | rtems_status_code status; |
---|
29 | Chain_Control empty; |
---|
30 | |
---|
31 | puts( "\n*** RTEMS WATCHDOG ***" ); |
---|
32 | |
---|
33 | puts( "INIT - report on empty watchdog chain" ); |
---|
34 | _Chain_Initialize_empty( &empty ); |
---|
35 | _Watchdog_Report_chain( "Empty Chain", &empty ); |
---|
36 | |
---|
37 | build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); |
---|
38 | |
---|
39 | status = rtems_clock_set( &time ); |
---|
40 | directive_failed( status, "rtems_clock_set" ); |
---|
41 | |
---|
42 | Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); |
---|
43 | Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); |
---|
44 | |
---|
45 | status = rtems_task_create( |
---|
46 | Task_name[ 1 ], |
---|
47 | 1, |
---|
48 | RTEMS_MINIMUM_STACK_SIZE * 2, |
---|
49 | RTEMS_DEFAULT_MODES, |
---|
50 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
51 | &Task_id[ 1 ] |
---|
52 | ); |
---|
53 | directive_failed( status, "rtems_task_create of TA1" ); |
---|
54 | |
---|
55 | status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); |
---|
56 | directive_failed( status, "rtems_task_start of TA1" ); |
---|
57 | |
---|
58 | puts( "INIT - rtems_timer_create - creating timer 1" ); |
---|
59 | status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); |
---|
60 | directive_failed( status, "rtems_timer_create" ); |
---|
61 | |
---|
62 | printf( "INIT - timer 1 has id (0x%" PRIxrtems_id ")\n", Timer_id[ 1 ] ); |
---|
63 | |
---|
64 | status = rtems_task_delete( RTEMS_SELF ); |
---|
65 | directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); |
---|
66 | |
---|
67 | |
---|
68 | rtems_test_exit( 0 ); |
---|
69 | } |
---|