source: rtems/testsuites/sptests/sp57/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.9 KB
Line 
1/*  Restart a task which is delaying
2 *
3 *  COPYRIGHT (c) 1989-2009.
4 *  On-Line Applications Research Corporation (OAR).
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 *
10 *  $Id$
11 */
12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <tmacros.h>
18
19rtems_task Delay_task(
20  rtems_task_argument ignored
21)
22{
23  rtems_status_code    status;
24
25  puts( "Delay - rtems_task_wake_after - OK" );
26  status = rtems_task_wake_after( RTEMS_MILLISECONDS_TO_TICKS(2000) );
27
28  puts( "ERROR - delay task woke up!!" );
29  rtems_test_exit(0);
30}
31
32rtems_task Init(
33  rtems_task_argument ignored
34)
35{
36  rtems_status_code    status;
37  rtems_id             task_id;
38
39  puts( "\n\n*** TEST 57 ***" );
40
41  puts( "Init - rtems_task_create - delay task - OK" );
42  status = rtems_task_create(
43     rtems_build_name( 'T', 'A', '1', ' ' ),
44     1,
45     RTEMS_MINIMUM_STACK_SIZE,
46     RTEMS_DEFAULT_OPTIONS,
47     RTEMS_DEFAULT_ATTRIBUTES,
48     &task_id
49  );
50  directive_failed( status, "rtems_task_create" );
51
52  puts( "Init - rtems_task_start - delay task - OK" );
53  status = rtems_task_start( task_id, Delay_task, 0 );
54  directive_failed( status, "rtems_task_start" );
55
56  puts( "Init - rtems_task_wake_after - let delay task block - OK" );
57  status = rtems_task_wake_after( RTEMS_MILLISECONDS_TO_TICKS(1000) );
58  directive_failed( status, "rtems_task_wake_after" );
59
60  puts( "Init - rtems_task_restart - delay task - OK" );
61  status = rtems_task_restart( task_id, 0 );
62  directive_failed( status, "rtems_task_restart" );
63
64  puts( "*** END OF TEST 57 ***" );
65  rtems_test_exit(0);
66}
67
68/* configuration information */
69
70#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
71#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
72
73#define CONFIGURE_MAXIMUM_TASKS             2
74#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
75
76#define CONFIGURE_INIT
77#include <rtems/confdefs.h>
78
79/* global variables */
Note: See TracBrowser for help on using the repository browser.