source: rtems/testsuites/samples/capture/init.c @ 3a9d9e1

4.115
Last change on this file since 3a9d9e1 was e313551, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 10:58:44

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *  It is called from init_exec and has the responsibility for creating
5 *  and starting the tasks that make up the test.  If the time of day
6 *  clock is required for the test, it should also be set to a known
7 *  value by this function.
8 *
9 *  Input parameters:  NONE
10 *
11 *  Output parameters:  NONE
12 *
13 *  COPYRIGHT (c) 1989-1997.
14 *  On-Line Applications Research Corporation (OAR).
15 *
16 *  The license and distribution terms for this file may in
17 *  the file LICENSE in this distribution or at
18 *  http://www.rtems.com/license/LICENSE.
19 *
20 *  $Id$
21 */
22
23#define CONFIGURE_INIT
24
25#ifdef HAVE_CONFIG_H
26#include "config.h"
27#endif
28
29#include "system.h"
30#include <stdio.h>
31#include <stdlib.h>
32
33#include <rtems.h>
34#include <rtems/capture-cli.h>
35#include <rtems/monitor.h>
36
37volatile int can_proceed = 1;
38
39rtems_task Init(
40  rtems_task_argument ignored
41)
42{
43#if BSP_SMALL_MEMORY
44  printf("NO Capture Engine. MEMORY TOO SMALL");
45#else
46  rtems_task_priority old_priority;
47  rtems_mode          old_mode;
48
49  /* lower the task priority to allow created tasks to execute */
50
51  rtems_task_set_priority(RTEMS_SELF, 20, &old_priority);
52  rtems_task_mode(RTEMS_PREEMPT,  RTEMS_PREEMPT_MASK, &old_mode);
53
54  printf( "\n*** CAPTURE ENGINE TEST ***\n" );
55
56  while (!can_proceed)
57  {
58    printf ("Sleeping\n");
59    usleep (1000000);
60  }
61
62  rtems_monitor_init (0);
63  rtems_capture_cli_init (0);
64
65  setup_tasks_to_watch ();
66
67  rtems_task_delete (RTEMS_SELF);
68#endif
69}
Note: See TracBrowser for help on using the repository browser.