summaryrefslogtreecommitdiff
path: root/nuttx/arch/pjrc-8051
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-27 16:19:51 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-27 16:19:51 +0000
commit938cfadb92f97978e6cc806e9b71e7ff07135d70 (patch)
treee2b7723d688605d9fe1c1f5170c55bf60d028a83 /nuttx/arch/pjrc-8051
parent2caf88c8c145a23f7a9d31fb4695617272dec0db (diff)
downloadpx4-nuttx-938cfadb92f97978e6cc806e9b71e7ff07135d70.tar.gz
px4-nuttx-938cfadb92f97978e6cc806e9b71e7ff07135d70.tar.bz2
px4-nuttx-938cfadb92f97978e6cc806e9b71e7ff07135d70.zip
Move PJRC led support into board-specific logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@159 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/pjrc-8051')
-rw-r--r--nuttx/arch/pjrc-8051/src/Makefile27
-rw-r--r--nuttx/arch/pjrc-8051/src/up_internal.h2
2 files changed, 23 insertions, 6 deletions
diff --git a/nuttx/arch/pjrc-8051/src/Makefile b/nuttx/arch/pjrc-8051/src/Makefile
index 51eaf269b..9a270a895 100644
--- a/nuttx/arch/pjrc-8051/src/Makefile
+++ b/nuttx/arch/pjrc-8051/src/Makefile
@@ -48,8 +48,7 @@ CSRCS = up_initialize.c up_idle.c up_interruptcontext.c \
up_releasepending.c up_reprioritizertr.c \
up_exit.c up_assert.c up_allocateheap.c \
up_irq.c up_savecontext.c up_restorecontext.c \
- up_timerisr.c up_putc.c up_debug.c up_leds.c \
- up_delay.c
+ up_timerisr.c up_putc.c up_debug.c up_delay.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(SSRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
@@ -70,6 +69,8 @@ TESTOBJS = $(TESTSRCS:.c=$(OBJEXT))
TESTLINKOBJS = up_head$(OBJEXT)
TESTEXTRAOBJS = up_savecontext$(OBJEXT) up_restorecontext$(OBJEXT)
+BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
+
IRAM_SIZE = 0x100
DEF_STACK_BASE = 0x24
LDFLAGS = --model-large --nostdlib \
@@ -163,16 +164,23 @@ $(SDCCLIBDIR)/libmysdcc.lib: $(SDCCLIBDIR)/libsdcc.lib
> libmysdcc.lib
@sudo mv -f libmysdcc.lib $(SDCCLIBDIR)/libmysdcc.lib
+# This builds the libboard library in the board/ subdirectory
+
+board/libboard$(LIBEXT):
+ $(MAKE) -C board TOPDIR=$(TOPDIR) libboard$(LIBEXT)
+
# This target builds the final executable
-pass1.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS)
- $(CC) $(LDFLAGS) $(LDPATHES) $(SDCCPATH) $(LINKOBJS) $(LDLIBS) $(SDCCLIBS) -o $@
+pass1.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBEXT)
+ $(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
+ $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@
@rm -f up_mem.h
@rm -f up_allocateheap$(OBJEXT) libarch$(LIBEXT)
@$(MAKE) TOPDIR=$(TOPDIR) libarch$(LIBEXT)
nuttx.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS)
- $(CC) $(LDFLAGS) $(LDPATHES) $(SDCCPATH) $(LINKOBJS) $(LDLIBS) $(SDCCLIBS) -o $@
+ $(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \
+ $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@
nuttx$(EXEEXT): pass1.ihx nuttx.ihx
@rm -f pass1.*
@@ -191,17 +199,26 @@ irqtest:
# Build dependencies
.depend: Makefile up_mem.h $(DEPSRCS)
+ @if [ -e board/Makefile ]; then \
+ $(MAKE) -C board TOPDIR=$(TOPDIR) depend ; \
+ if
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
touch $@
depend: .depend
clean:
+ @if [ -e board/Makefile ]; then \
+ $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \
+ fi
rm -f libarch$(LIBEXT) up_mem.h
rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex *~
if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi
distclean: clean
+ @if [ -e board/Makefile ]; then \
+ $(MAKE) -C board TOPDIR=$(TOPDIR) distclean ; \
+ fi
rm -f Make.dep .depend
-include Make.dep
diff --git a/nuttx/arch/pjrc-8051/src/up_internal.h b/nuttx/arch/pjrc-8051/src/up_internal.h
index 760a0ff29..90ba556e9 100644
--- a/nuttx/arch/pjrc-8051/src/up_internal.h
+++ b/nuttx/arch/pjrc-8051/src/up_internal.h
@@ -134,7 +134,7 @@ extern void up_dumpframe(FAR struct xcptcontext *context);
# define up_dumpframe(x)
#endif
-/* Defined in up_leds.c */
+/* Defined in board/up_leds.c */
#ifdef CONFIG_ARCH_LEDS
extern void up_ledinit(void);