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
This commit is contained in:
patacongo 2007-03-26 22:14:28 +00:00
parent 8145d47cc8
commit 0d7cd9eafa
4 changed files with 21 additions and 8 deletions

View File

@ -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

View File

@ -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);

View File

@ -117,7 +117,7 @@ __start:
#endif
/* Initialize onboard LEDs */
#ifdef CONFIG_C5471_LEDS
#ifdef CONFIG_ARCH_LEDS
bl up_ledinit
#endif

View File

@ -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);