From f13ef5f500a87f70310c8bc8c2effb4b64e31576 Mon Sep 17 00:00:00 2001 From: Oliver Hahm Date: Mon, 1 Apr 2013 00:18:07 +0200 Subject: [PATCH] * restructured cpu folder to distinguish between arm and lpc common files --- Makefile.include | 4 +++- Makefile.modules | 21 +------------------- cpu/Makefile | 10 ++++++++-- cpu/Makefile.include | 21 ++++++++++++++++++++ cpu/arm_common/arm_cpu.c | 3 +++ cpu/lpc_common/Makefile | 4 ++++ cpu/{arm_common => lpc_common}/hwtimer_cpu.c | 0 cpu/{arm_common => lpc_common}/iap.c | 2 +- 8 files changed, 41 insertions(+), 24 deletions(-) create mode 100644 cpu/Makefile.include create mode 100644 cpu/lpc_common/Makefile rename cpu/{arm_common => lpc_common}/hwtimer_cpu.c (100%) rename cpu/{arm_common => lpc_common}/iap.c (99%) diff --git a/Makefile.include b/Makefile.include index e5fadea984..0ba16357ea 100644 --- a/Makefile.include +++ b/Makefile.include @@ -1,3 +1,4 @@ +# set undefined variables ifeq ($(strip $(RIOTCPU)),) export RIOTCPU =$(RIOTBASE)/cpu endif @@ -11,8 +12,9 @@ BB = $(shell echo $(BOARD)|tr 'a-z' 'A-Z') CFLAGS += -DBOARD=$(BB) export CFLAGS -# mandatory include! +# mandatory includes! include $(RIOTBOARD)/$(BOARD)/Makefile.include +include $(RIOTCPU)/Makefile.include include $(RIOTBASE)/Makefile.modules # your binaries to link diff --git a/Makefile.modules b/Makefile.modules index 7db7896173..233f0416f2 100644 --- a/Makefile.modules +++ b/Makefile.modules @@ -1,26 +1,7 @@ export MAKEBASE =$(RIOTBASE) export BINDIR =$(RIOTBASE)/bin/ -UNDEF = $(BINDIR)startup.o +UNDEF += $(BINDIR)startup.o -### Minimal setup -ifeq ($(CPU),lpc2387) - USEMODULE += arm_common - UNDEF += $(BINDIR)syscalls.o - export INCLUDES += -I$(RIOTBASE)/cpu/arm_common/include -endif -ifeq ($(CPU),lpc214x) - USEMODULE += arm_common - UNDEF += $(BINDIR)syscalls.o -endif -ifeq ($(CPU),native) - export INCLUDES += -I$(RIOTBASE)/cpu/native/include -endif -ifeq ($(CPU),stm32f407vgt6) - USEMODULE += stm32f4xxstdperi - UNDEF += $(BINDIR)syscalls.o -endif - -#USEMODULE += cpu_drivers cpu core lib sys USEMODULE += cpu core sys ED = $(USEMODULE:%=-DMODULE_%) EXTDEFINES = $(shell echo $(ED)|tr 'a-z' 'A-Z') diff --git a/cpu/Makefile b/cpu/Makefile index b0f6e8f4df..19c8c89533 100644 --- a/cpu/Makefile +++ b/cpu/Makefile @@ -1,9 +1,13 @@ ifeq ($(CPU),lpc2387) - DIRS = arm_common lpc2387 + DIRS = arm_common lpc_common lpc2387 endif ifeq ($(CPU),lpc214x) - DIRS = arm_common lpc214x + DIRS = arm_common lpc_common lpc214x +endif + +ifeq ($(CPU),mc1322x) + DIRS = arm_common mc1322x endif ifeq ($(CPU),cc430) @@ -28,6 +32,8 @@ $(DIRS): clean: @$(MAKE) -C lpc2387 clean + @$(MAKE) -C mc1322x clean + @$(MAKE) -C lpc_common clean @$(MAKE) -C arm_common clean @$(MAKE) -C cc430 clean @$(MAKE) -C msp430-common clean diff --git a/cpu/Makefile.include b/cpu/Makefile.include new file mode 100644 index 0000000000..968ca3812b --- /dev/null +++ b/cpu/Makefile.include @@ -0,0 +1,21 @@ +### Minimal setup +ifeq ($(CPU),lpc2387) + export USEMODULE += arm_common lpc_common + export UNDEF += $(BINDIR)syscalls.o + export INCLUDES += -I$(RIOTCPU)/arm_common/include + export INCLUDES += -I$(RIOTCPU)/lpc_common/include +endif +ifeq ($(CPU),lpc214x) + export USEMODULE += arm_common lpc_common + export UNDEF += $(BINDIR)syscalls.o + export INCLUDES += -I$(RIOTCPU)/arm_common/include + export INCLUDES += -I$(RIOTCPU)/lpc_common/include +endif +ifeq ($(CPU),mc1322x) + export USEMODULE += arm_common + export UNDEF += $(BINDIR)syscalls.o + export INCLUDES += -I$(RIOTBASE)/cpu/arm_common/include +endif +ifeq ($(CPU),native) + export INCLUDES += -I$(RIOTBASE)/cpu/native/include +endif diff --git a/cpu/arm_common/arm_cpu.c b/cpu/arm_common/arm_cpu.c index 36ee390405..97d3d13d38 100644 --- a/cpu/arm_common/arm_cpu.c +++ b/cpu/arm_common/arm_cpu.c @@ -86,6 +86,8 @@ void thread_print_stack(void) printf("STACK (%u)= %X \n",i,*s); } +/* LPC specific */ +#ifdef WDTC __attribute__((naked,noreturn)) void arm_reset(void) { dINT(); @@ -95,3 +97,4 @@ __attribute__((naked,noreturn)) void arm_reset(void) WDFEED= 0x55; while(1); } +#endif diff --git a/cpu/lpc_common/Makefile b/cpu/lpc_common/Makefile new file mode 100644 index 0000000000..b8ccbfb0ef --- /dev/null +++ b/cpu/lpc_common/Makefile @@ -0,0 +1,4 @@ +MODULE =lpc_common + +include $(RIOTBASE)/Makefile.base + diff --git a/cpu/arm_common/hwtimer_cpu.c b/cpu/lpc_common/hwtimer_cpu.c similarity index 100% rename from cpu/arm_common/hwtimer_cpu.c rename to cpu/lpc_common/hwtimer_cpu.c diff --git a/cpu/arm_common/iap.c b/cpu/lpc_common/iap.c similarity index 99% rename from cpu/arm_common/iap.c rename to cpu/lpc_common/iap.c index 0f0b418abe..0e67f23589 100644 --- a/cpu/arm_common/iap.c +++ b/cpu/lpc_common/iap.c @@ -1,13 +1,13 @@ /* iap driver * * based on iap driver for LPC2148 Controller made by Andreas Weschenfelder, 2008 - * see: * */ #include #include #include +/* TODO: replace by a lpc generic header */ #include //#define ENABLE_DEBUG