From 583e00d2d967f07b251ed3e8503c0648114518b6 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Sun, 29 Mar 2009 09:42:20 -0400 Subject: [PATCH] checkpoint... working on multiple test objects. --- Makefile | 6 +++--- {src => tests}/test-blink.c | 0 tests/test-blink2.c | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) rename {src => tests}/test-blink.c (100%) create mode 100644 tests/test-blink2.c diff --git a/Makefile b/Makefile index c0be548b6..f735dbdde 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ include $(TOPDIR)/config.mk AOBJS = COBJS = $(patsubst %.c,%.o,$(wildcard src/*.c)) -TARGETS = test-blink.o +TARGETS = $(patsubst %.c,%.o,$(wildcard tests/*.c)) # Add GCC lib PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc @@ -52,9 +52,9 @@ PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-l ######################################################################### #ALL = blink.srec blink.bin blink.dis blink.System.map -ALL = $(TARGETS:.o=.srec) $(TARGETS:.o=.bin) $(TARGETS:.o=.dis) +ALL = $(TARGETS:.c=.srec) $(TARGETS:.c=.bin) $(TARGETS:.c=.dis) -.PRECIOUS: $(COBJS) +.PRECIOUS: $(COBJS) $(TARGETS) all: $(ALL) diff --git a/src/test-blink.c b/tests/test-blink.c similarity index 100% rename from src/test-blink.c rename to tests/test-blink.c diff --git a/tests/test-blink2.c b/tests/test-blink2.c new file mode 100644 index 000000000..794d82652 --- /dev/null +++ b/tests/test-blink2.c @@ -0,0 +1,26 @@ +#define MBAR_GPIO 0x80000000 +#define GPIO_PAD_DIR0 0x80000000 +#define GPIO_DATA0 0x80000008 +#define UART1_DATA 0x80005008 +#define DELAY 400000 + +#include "embedded_types.h" + +void main(void) { + + *(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000100; + + volatile uint32_t i; + + while(1) { + + *(volatile uint32_t *)GPIO_DATA0 = 0x00000100; + + for(i=0; i