source: examples-v2/led/ratemon1/init.c @ 3083373

4.11baseexamples-v2-4-10-branch initial
Last change on this file since 3083373 was 3083373, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 6, 2009 at 8:25:58 PM

Initial import of reorganized examples.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2007.
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 *  $Id$
10 */
11
12#include <stdio.h>
13#include <bsp.h>
14
15#include "../../testmacros.h"
16#include "../led.h"
17
18rtems_task Init(
19  rtems_task_argument argument
20)
21{
22  rtems_status_code status;
23  rtems_id          period_id;
24  rtems_interval    ticks;
25  uint32_t          count;
26
27  puts( "\n\n*** LED BLINKER -- single period ***" );
28
29  LED_INIT();
30
31  status = rtems_rate_monotonic_create(
32    rtems_build_name( 'P', 'E', 'R', '1' ),
33    &period_id
34  );
35
36  count = 0;
37  ticks = get_ticks_per_second();
38
39  while (1) {
40    status = rtems_rate_monotonic_period( period_id, ticks );
41    if ( (++count % 2) == 0 )
42      LED_ON();
43    else
44      LED_OFF();
45  }
46
47  status = rtems_task_delete( RTEMS_SELF );
48}
49
50/**************** START OF CONFIGURATION INFORMATION ****************/
51
52#define CONFIGURE_INIT
53#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
54#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
55
56#define CONFIGURE_MAXIMUM_TASKS             1
57#define CONFIGURE_MAXIMUM_PERIODS           1
58
59#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
60
61#define CONFIGURE_EXTRA_TASK_STACKS         (3 * RTEMS_MINIMUM_STACK_SIZE)
62
63#include <rtems/confdefs.h>
64
65/****************  END OF CONFIGURATION INFORMATION  ****************/
Note: See TracBrowser for help on using the repository browser.