From e3872c255c376176d377b0cb03ceedfe4b487242 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Mar 2007 22:14:28 +0000 Subject: Add a directory to hold board-specific drivers git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@151 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/c5471/src/Makefile | 21 +++++++++++++++++---- nuttx/arch/c5471/src/up_assert.c | 4 ++-- nuttx/arch/c5471/src/up_head.S | 2 +- nuttx/arch/c5471/src/up_internal.h | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) (limited to 'nuttx/arch/c5471/src') diff --git a/nuttx/arch/c5471/src/Makefile b/nuttx/arch/c5471/src/Makefile index b282cbf8d..770c4e3a6 100644 --- a/nuttx/arch/c5471/src/Makefile +++ b/nuttx/arch/c5471/src/Makefile @@ -51,7 +51,7 @@ CSRCS = up_initialize.c up_initialstate.c up_idle.c up_doirq.c \ up_exit.c up_assert.c up_blocktask.c up_unblocktask.c \ up_releasepending.c up_reprioritizertr.c up_copystate.c \ up_schedulesigaction.c up_sigdeliver.c up_serial.c \ - up_delay.c up_allocateheap.c up_leds.c up_watchdog.c + up_delay.c up_allocateheap.c up_watchdog.c COBJS = $(CSRCS:.c=.o) SRCS = $(ASRCS) $(CSRCS) @@ -65,6 +65,8 @@ LINKLIBS = LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS))) LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS)))) +BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board + LIBGCC = ${shell $(CC) -print-libgcc-file-name} all: up_head.o libarch$(LIBEXT) @@ -81,9 +83,12 @@ libarch$(LIBEXT): $(OBJS) { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ done ; ) -nuttx: $(LINKOBJS) - $(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \ - --start-group $(LDLIBS) --end-group $(EXTRA_LIBS) $(LIBGCC) +board/libboard$(LIBEXT): + $(MAKE) -C board TOPDIR=$(TOPDIR) libboard$(LIBEXT) + +nuttx: $(LINKOBJS) board/libboard$(LIBEXT) + $(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(LINKOBJS) \ + --start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC) @$(NM) $(TOPDIR)/$@ | \ grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map @@ -100,15 +105,23 @@ ifeq ($(CONFIG_RRLOAD_BINARY),y) endif .depend: Makefile $(SRCS) + echo $(SRCS) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(MAKE) -C board TOPDIR=$(TOPDIR) depend touch $@ depend: .depend clean: rm -f libarch$(LIBEXT) *.o *~ + @if [ -e board/Makefile ]; then \ + $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \ + fi distclean: clean rm -f Make.dep .depend + @if [ -e board/Makefile ]; then \ + $(MAKE) -C board TOPDIR=$(TOPDIR) distclean ; \ + fi -include Make.dep diff --git a/nuttx/arch/c5471/src/up_assert.c b/nuttx/arch/c5471/src/up_assert.c index 6edc2c4df..0dad02f89 100644 --- a/nuttx/arch/c5471/src/up_assert.c +++ b/nuttx/arch/c5471/src/up_assert.c @@ -79,7 +79,7 @@ static inline uint32 up_getsp(void) * Name: up_stackdump ************************************************************/ -#ifdef CONFIG_C5471_STACKDUMP +#ifdef CONFIG_ARCH_STACKDUMP static void up_stackdump(void) { _TCB *rtcb = (_TCB*)g_readytorun.head; @@ -137,7 +137,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */ (void)irqsave(); for(;;) { -#ifdef CONFIG_C5471_LEDS +#ifdef CONFIG_ARCH_LEDS up_ledon(LED_PANIC); up_delay(250); up_ledoff(LED_PANIC); diff --git a/nuttx/arch/c5471/src/up_head.S b/nuttx/arch/c5471/src/up_head.S index 770caddce..d681a177e 100644 --- a/nuttx/arch/c5471/src/up_head.S +++ b/nuttx/arch/c5471/src/up_head.S @@ -117,7 +117,7 @@ __start: #endif /* Initialize onboard LEDs */ -#ifdef CONFIG_C5471_LEDS +#ifdef CONFIG_ARCH_LEDS bl up_ledinit #endif diff --git a/nuttx/arch/c5471/src/up_internal.h b/nuttx/arch/c5471/src/up_internal.h index 60cc25273..fc5f92f7b 100644 --- a/nuttx/arch/c5471/src/up_internal.h +++ b/nuttx/arch/c5471/src/up_internal.h @@ -153,7 +153,7 @@ extern void up_maskack_irq(int irq); /* Defined in up_leds.c */ -#ifdef CONFIG_C5471_LEDS +#ifdef CONFIG_ARCH_LEDS extern void up_ledinit(void); extern void up_ledon(int led); extern void up_ledoff(int led); -- cgit v1.2.3