[22fa9d61] | 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 | /* #define HAVE_MENU */ |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | rtems_task Init( |
---|
| 27 | rtems_task_argument argument |
---|
| 28 | ) |
---|
| 29 | { |
---|
| 30 | rtems_time_of_day time; |
---|
| 31 | rtems_status_code status; |
---|
| 32 | |
---|
| 33 | puts( "\n*** RTEMS WATCHDOG ***" ); |
---|
| 34 | |
---|
| 35 | /* XXXXXX |
---|
| 36 | _Watchdog_Report_chain( |
---|
| 37 | "_Watchdog_Ticks_chain", |
---|
| 38 | & _Watchdog_Ticks_chain |
---|
| 39 | ); |
---|
| 40 | puts( "*** END OF RTEMS WATCHDOG PROGRAM ***" ); |
---|
| 41 | */ |
---|
| 42 | |
---|
| 43 | build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); |
---|
| 44 | |
---|
| 45 | status = rtems_clock_set( &time ); |
---|
| 46 | directive_failed( status, "rtems_clock_set" ); |
---|
| 47 | |
---|
| 48 | Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); |
---|
| 49 | Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); |
---|
| 50 | |
---|
| 51 | status = rtems_task_create( |
---|
| 52 | Task_name[ 1 ], |
---|
| 53 | 1, |
---|
| 54 | RTEMS_MINIMUM_STACK_SIZE * 2, |
---|
| 55 | RTEMS_DEFAULT_MODES, |
---|
| 56 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
| 57 | &Task_id[ 1 ] |
---|
| 58 | ); |
---|
| 59 | directive_failed( status, "rtems_task_create of TA1" ); |
---|
| 60 | |
---|
| 61 | status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); |
---|
| 62 | directive_failed( status, "rtems_task_start of TA1" ); |
---|
| 63 | |
---|
| 64 | puts( "INIT - rtems_timer_create - creating timer 1" ); |
---|
| 65 | status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); |
---|
| 66 | directive_failed( status, "rtems_timer_create" ); |
---|
| 67 | |
---|
| 68 | printf( "INIT - timer 1 has id (0x%x)\n", Timer_id[ 1 ] ); |
---|
| 69 | |
---|
| 70 | status = rtems_task_delete( RTEMS_SELF ); |
---|
| 71 | directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | rtems_test_exit( 0 ); |
---|
| 75 | } |
---|