source: rtems/testsuites/sptests/sp32/init.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <tmacros.h>  /* includes bsp.h, stdio, etc... */
15
16rtems_task Init(
17    rtems_task_argument ignored
18) {
19  rtems_status_code  status;
20  rtems_interval     timestamps[6],
21                     wantintervals[5] = { 1, 50, 200, 25, 3 };
22  rtems_name         period_name = rtems_build_name('P','E','R','a');
23  rtems_id           period_id;
24  int                loopy;
25
26  printf("\n\n*** TEST 32 ***\n");
27
28  /* create period */
29  status = rtems_rate_monotonic_create(
30      period_name,
31      &period_id
32  );
33  directive_failed(status, "rate_monotonic_create");
34
35  /* start period with initial value */
36  status = rtems_rate_monotonic_period( period_id, wantintervals[0] );
37  directive_failed(status, "rate_monotonic_period #1");
38
39  /* get our first timestamp */
40  timestamps[0] = rtems_clock_get_ticks_since_boot();
41
42  /* loop through and gather more timestamps */
43  for (loopy = 1; loopy < 5; loopy++) {
44
45    status = rtems_rate_monotonic_period( period_id, wantintervals[loopy] );
46    directive_failed(status, "rate_monotonic_period #2");
47
48    timestamps[loopy] = rtems_clock_get_ticks_since_boot();
49  }
50
51  /* block one last time */
52  status = rtems_rate_monotonic_period( period_id, 1 );
53  directive_failed(status, "rate_monotonic_period #3");
54
55  /* get one last timestamp */
56  timestamps[loopy] = rtems_clock_get_ticks_since_boot();
57
58  /* cancel the period */
59  status = rtems_rate_monotonic_cancel(period_id);
60  directive_failed(status, "rate_monotonic_cancel");
61
62  /* delete it */
63  status = rtems_rate_monotonic_delete(period_id);
64  directive_failed(status, "rate_monotonic_delete");
65
66  /* tabulate and print results */
67  for (loopy = 0; loopy < 5; loopy++) {
68    printf(
69      "period %d: measured %" PRIdrtems_interval " tick(s), wanted %"
70        PRIdrtems_interval "\n",
71      loopy,
72      timestamps[loopy+1] - timestamps[loopy],
73      wantintervals[loopy]
74    );
75  }
76
77  puts("*** END OF TEST 32 ***");
78  rtems_test_exit(0);
79}
80
81#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
82
83#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
84#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
85#define CONFIGURE_MAXIMUM_TASKS        1
86#define CONFIGURE_MAXIMUM_PERIODS      1
87
88#define CONFIGURE_MICROSECONDS_PER_TICK 100000
89
90#define CONFIGURE_INIT
91
92#include <rtems/confdefs.h>
93
Note: See TracBrowser for help on using the repository browser.