multiple tests work now.
added blink code for all the leds.
This commit is contained in:
parent
583e00d2d9
commit
b77fb10e63
14
Makefile
14
Makefile
|
@ -44,7 +44,9 @@ include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
AOBJS =
|
AOBJS =
|
||||||
COBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
|
COBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
|
||||||
TARGETS = $(patsubst %.c,%.o,$(wildcard tests/*.c))
|
TESTS = $(wildcard tests/*.c)
|
||||||
|
TARGETS = $(patsubst %.c,%.o,$(TESTS))
|
||||||
|
|
||||||
|
|
||||||
# Add GCC lib
|
# Add GCC lib
|
||||||
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
||||||
|
@ -52,9 +54,9 @@ PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-l
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
#ALL = blink.srec blink.bin blink.dis blink.System.map
|
#ALL = blink.srec blink.bin blink.dis blink.System.map
|
||||||
ALL = $(TARGETS:.c=.srec) $(TARGETS:.c=.bin) $(TARGETS:.c=.dis)
|
ALL = $(TARGETS) $(TESTS:.c=.srec) $(TESTS:.c=.bin) $(TESTS:.c=.dis)
|
||||||
|
|
||||||
.PRECIOUS: $(COBJS) $(TARGETS)
|
.PRECIOUS: $(COBJS) $(TARGETS) $(TESTS:.c=.obj)
|
||||||
|
|
||||||
all: $(ALL)
|
all: $(ALL)
|
||||||
|
|
||||||
|
@ -70,10 +72,10 @@ all: $(ALL)
|
||||||
%.dis: %.obj
|
%.dis: %.obj
|
||||||
$(OBJDUMP) -DS $< > $@
|
$(OBJDUMP) -DS $< > $@
|
||||||
|
|
||||||
%.obj: $(AOBJS) $(COBJS) $(LDSCRIPT)
|
%.obj: $(AOBJS) $(COBJS) $(TARGETS) $(LDSCRIPT)
|
||||||
$(LD) $(LDFLAGS) $(AOBJS) $(COBJS) \
|
$(LD) $(LDFLAGS) $(AOBJS) $(COBJS) \
|
||||||
--start-group $(PLATFORM_LIBS) --end-group \
|
--start-group $(PLATFORM_LIBS) --end-group \
|
||||||
-Map $*.map -o $@
|
-Map $*.map $*.o -o $@
|
||||||
|
|
||||||
|
|
||||||
%.System.map: %.obj
|
%.System.map: %.obj
|
||||||
|
@ -99,7 +101,7 @@ clean:
|
||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
find . -type f \
|
find . -type f \
|
||||||
\( -name .depend -o -name '*.srec' -o -name '*.bin' -o -name '*.dis' -o -name '*.map' \) \
|
\( -name .depend -o -name '*.srec' -o -name '*.bin' -o -name '*.dis' -o -name '*.map' -o -name '*.obj' \) \
|
||||||
-print \
|
-print \
|
||||||
| xargs rm -f
|
| xargs rm -f
|
||||||
rm -f $(OBJS) *.bak tags TAGS
|
rm -f $(OBJS) *.bak tags TAGS
|
||||||
|
|
|
@ -8,13 +8,13 @@
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
|
|
||||||
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000100;
|
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000400;
|
||||||
|
|
||||||
volatile uint32_t i;
|
volatile uint32_t i;
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
|
||||||
*(volatile uint32_t *)GPIO_DATA0 = 0x00000100;
|
*(volatile uint32_t *)GPIO_DATA0 = 0x00000400;
|
||||||
|
|
||||||
for(i=0; i<DELAY; i++) { continue; }
|
for(i=0; i<DELAY; i++) { continue; }
|
||||||
|
|
26
tests/blink-green.c
Normal file
26
tests/blink-green.c
Normal file
|
@ -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 = 0x00000200;
|
||||||
|
|
||||||
|
volatile uint32_t i;
|
||||||
|
|
||||||
|
while(1) {
|
||||||
|
|
||||||
|
*(volatile uint32_t *)GPIO_DATA0 = 0x00000200;
|
||||||
|
|
||||||
|
for(i=0; i<DELAY; i++) { continue; }
|
||||||
|
|
||||||
|
*(volatile uint32_t *)GPIO_DATA0 = 0x00000000;
|
||||||
|
|
||||||
|
for(i=0; i<DELAY; i++) { continue; }
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
26
tests/blink-white.c
Normal file
26
tests/blink-white.c
Normal file
|
@ -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 = 0x00000700;
|
||||||
|
|
||||||
|
volatile uint32_t i;
|
||||||
|
|
||||||
|
while(1) {
|
||||||
|
|
||||||
|
*(volatile uint32_t *)GPIO_DATA0 = 0x00000700;
|
||||||
|
|
||||||
|
for(i=0; i<DELAY; i++) { continue; }
|
||||||
|
|
||||||
|
*(volatile uint32_t *)GPIO_DATA0 = 0x00000000;
|
||||||
|
|
||||||
|
for(i=0; i<DELAY; i++) { continue; }
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue