source: rtems/testsuites/sptests/spwatchdog/init.c @ 7d3f9c6

4.115
Last change on this file since 7d3f9c6 was 7d3f9c6, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 07:37:03

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 1.7 KB
Line 
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#ifdef HAVE_CONFIG_H
21#include "config.h"
22#endif
23
24#define CONFIGURE_INIT
25#include "system.h"
26
27rtems_task Init(
28  rtems_task_argument argument
29)
30{
31  rtems_time_of_day  time;
32  rtems_status_code  status;
33  Chain_Control      empty;
34
35   puts( "\n*** RTEMS WATCHDOG ***" );
36
37  puts( "INIT - report on empty watchdog chain" );
38  _Chain_Initialize_empty( &empty );
39  _Watchdog_Report_chain( "Empty Chain", &empty );
40
41  build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
42
43  status = rtems_clock_set( &time );
44  directive_failed( status, "rtems_clock_set" );
45
46  Task_name[ 1 ]  = rtems_build_name( 'T', 'A', '1', ' ' );
47  Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
48
49  status = rtems_task_create(
50    Task_name[ 1 ],
51    1,
52    RTEMS_MINIMUM_STACK_SIZE * 2,
53    RTEMS_DEFAULT_MODES,
54    RTEMS_DEFAULT_ATTRIBUTES,
55    &Task_id[ 1 ]
56  );
57  directive_failed( status, "rtems_task_create of TA1" );
58
59  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
60  directive_failed( status, "rtems_task_start of TA1" );
61
62  puts( "INIT - rtems_timer_create - creating timer 1" );
63  status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
64  directive_failed( status, "rtems_timer_create" );
65
66  printf( "INIT - timer 1 has id (0x%" PRIxrtems_id ")\n", Timer_id[ 1 ] );
67
68  status = rtems_task_delete( RTEMS_SELF );
69  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
70
71
72  rtems_test_exit( 0 );
73}
Note: See TracBrowser for help on using the repository browser.