diff options
Diffstat (limited to 'led/delay')
-rw-r--r-- | led/delay/.cvsignore | 1 | ||||
-rw-r--r-- | led/delay/Makefile | 27 | ||||
-rw-r--r-- | led/delay/init.c | 52 |
3 files changed, 80 insertions, 0 deletions
diff --git a/led/delay/.cvsignore b/led/delay/.cvsignore new file mode 100644 index 0000000..fecf58a --- /dev/null +++ b/led/delay/.cvsignore @@ -0,0 +1 @@ +o-optimize diff --git a/led/delay/Makefile b/led/delay/Makefile new file mode 100644 index 0000000..c74de73 --- /dev/null +++ b/led/delay/Makefile @@ -0,0 +1,27 @@ +# +# $Id$ +# + +# +# RTEMS_MAKEFILE_PATH is typically set in an environment variable +# + +PGM=${ARCH}/delay.exe + +# optional managers required +MANAGERS=all + +# C source names +CSRCS = init.c +COBJS = $(CSRCS:%.c=${ARCH}/%.o) + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS) + +all: ${ARCH} $(PGM) + +$(PGM): $(OBJS) + $(make-exe) diff --git a/led/delay/init.c b/led/delay/init.c new file mode 100644 index 0000000..373f432 --- /dev/null +++ b/led/delay/init.c @@ -0,0 +1,52 @@ +/* + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include <stdio.h> +#include <bsp.h> + +#include "../../testmacros.h" +#include "../led.h" + +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + puts( "\n\n*** LED BLINKER -- task wake after ***" ); + + LED_INIT(); + + while (1) { + + (void) rtems_task_wake_after( 1 * get_ticks_per_second() ); + LED_ON(); + (void) rtems_task_wake_after( 1 * get_ticks_per_second() ); + LED_OFF(); + + } + + status = rtems_task_delete( RTEMS_SELF ); +} + +/**************** START OF CONFIGURATION INFORMATION ****************/ + +#define CONFIGURE_INIT +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#include <rtems/confdefs.h> + +/**************** END OF CONFIGURATION INFORMATION ****************/ |