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:
parent
8145d47cc8
commit
0d7cd9eafa
@ -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_exit.c up_assert.c up_blocktask.c up_unblocktask.c \
|
||||||
up_releasepending.c up_reprioritizertr.c up_copystate.c \
|
up_releasepending.c up_reprioritizertr.c up_copystate.c \
|
||||||
up_schedulesigaction.c up_sigdeliver.c up_serial.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)
|
COBJS = $(CSRCS:.c=.o)
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
@ -65,6 +65,8 @@ LINKLIBS =
|
|||||||
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
||||||
|
|
||||||
|
BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
|
||||||
|
|
||||||
LIBGCC = ${shell $(CC) -print-libgcc-file-name}
|
LIBGCC = ${shell $(CC) -print-libgcc-file-name}
|
||||||
|
|
||||||
all: up_head.o libarch$(LIBEXT)
|
all: up_head.o libarch$(LIBEXT)
|
||||||
@ -81,9 +83,12 @@ libarch$(LIBEXT): $(OBJS)
|
|||||||
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
||||||
done ; )
|
done ; )
|
||||||
|
|
||||||
nuttx: $(LINKOBJS)
|
board/libboard$(LIBEXT):
|
||||||
$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \
|
$(MAKE) -C board TOPDIR=$(TOPDIR) libboard$(LIBEXT)
|
||||||
--start-group $(LDLIBS) --end-group $(EXTRA_LIBS) $(LIBGCC)
|
|
||||||
|
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)/$@ | \
|
@$(NM) $(TOPDIR)/$@ | \
|
||||||
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||||
sort > $(TOPDIR)/System.map
|
sort > $(TOPDIR)/System.map
|
||||||
@ -100,15 +105,23 @@ ifeq ($(CONFIG_RRLOAD_BINARY),y)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
.depend: Makefile $(SRCS)
|
.depend: Makefile $(SRCS)
|
||||||
|
echo $(SRCS)
|
||||||
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||||
|
$(MAKE) -C board TOPDIR=$(TOPDIR) depend
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
depend: .depend
|
depend: .depend
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f libarch$(LIBEXT) *.o *~
|
rm -f libarch$(LIBEXT) *.o *~
|
||||||
|
@if [ -e board/Makefile ]; then \
|
||||||
|
$(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \
|
||||||
|
fi
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f Make.dep .depend
|
rm -f Make.dep .depend
|
||||||
|
@if [ -e board/Makefile ]; then \
|
||||||
|
$(MAKE) -C board TOPDIR=$(TOPDIR) distclean ; \
|
||||||
|
fi
|
||||||
|
|
||||||
-include Make.dep
|
-include Make.dep
|
||||||
|
@ -79,7 +79,7 @@ static inline uint32 up_getsp(void)
|
|||||||
* Name: up_stackdump
|
* Name: up_stackdump
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_C5471_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_stackdump(void)
|
static void up_stackdump(void)
|
||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
@ -137,7 +137,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
|
|||||||
(void)irqsave();
|
(void)irqsave();
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_C5471_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
up_ledon(LED_PANIC);
|
up_ledon(LED_PANIC);
|
||||||
up_delay(250);
|
up_delay(250);
|
||||||
up_ledoff(LED_PANIC);
|
up_ledoff(LED_PANIC);
|
||||||
|
@ -117,7 +117,7 @@ __start:
|
|||||||
#endif
|
#endif
|
||||||
/* Initialize onboard LEDs */
|
/* Initialize onboard LEDs */
|
||||||
|
|
||||||
#ifdef CONFIG_C5471_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
bl up_ledinit
|
bl up_ledinit
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ extern void up_maskack_irq(int irq);
|
|||||||
|
|
||||||
/* Defined in up_leds.c */
|
/* Defined in up_leds.c */
|
||||||
|
|
||||||
#ifdef CONFIG_C5471_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
extern void up_ledinit(void);
|
extern void up_ledinit(void);
|
||||||
extern void up_ledon(int led);
|
extern void up_ledon(int led);
|
||||||
extern void up_ledoff(int led);
|
extern void up_ledoff(int led);
|
||||||
|
Loading…
Reference in New Issue
Block a user