diff --git a/cpu/atmega1281/Makefile.dep b/cpu/atmega1281/Makefile.dep new file mode 100644 index 0000000000..a348f4ade4 --- /dev/null +++ b/cpu/atmega1281/Makefile.dep @@ -0,0 +1,6 @@ +# expand atmega_pcint for additional PCINTs of atmega1281 +ifneq (,$(filter atmega_pcint,$(USEMODULE))) + USEMODULE += atmega_pcint1 atmega_pcint2 +endif + +include $(RIOTCPU)/atmega_common/Makefile.dep diff --git a/cpu/atmega1281/Makefile.include b/cpu/atmega1281/Makefile.include index 3c826aa587..7abf3c2509 100644 --- a/cpu/atmega1281/Makefile.include +++ b/cpu/atmega1281/Makefile.include @@ -1,13 +1,5 @@ -# tell the build system that the CPU depends on the atmega common files -USEMODULE += atmega_common - RAM_LEN = 8K ROM_LEN = 128K -# expand atmega_pcint for additional PCINTs of atmega1281 -ifneq (,$(filter atmega_pcint,$(USEMODULE))) - USEMODULE += atmega_pcint1 atmega_pcint2 -endif - # CPU depends on the atmega common module, so include it include $(RIOTCPU)/atmega_common/Makefile.include diff --git a/cpu/atmega1284p/Makefile.include b/cpu/atmega1284p/Makefile.include index 6bd27a9343..368ebd5779 100644 --- a/cpu/atmega1284p/Makefile.include +++ b/cpu/atmega1284p/Makefile.include @@ -1,13 +1,5 @@ -# tell the build system that the CPU depends on the atmega common files -USEMODULE += atmega_common - RAM_LEN = 16K ROM_LEN = 128K -# expand atmega_pcint for atmega1284p -ifneq (,$(filter atmega_pcint,$(USEMODULE))) - USEMODULE += atmega_pcint1 atmega_pcint2 atmega_pcint3 -endif - # CPU depends on the atmega common module, so include it include $(RIOTCPU)/atmega_common/Makefile.include diff --git a/cpu/atmega128rfa1/Makefile.include b/cpu/atmega128rfa1/Makefile.include index 93564e8080..368ebd5779 100644 --- a/cpu/atmega128rfa1/Makefile.include +++ b/cpu/atmega128rfa1/Makefile.include @@ -1,13 +1,5 @@ -# tell the build system that the CPU depends on the atmega common files -USEMODULE += atmega_common - RAM_LEN = 16K ROM_LEN = 128K -# expand atmega_pcint for atmega128rfa1 -ifneq (,$(filter atmega_pcint,$(USEMODULE))) - USEMODULE += atmega_pcint1 -endif - # CPU depends on the atmega common module, so include it include $(RIOTCPU)/atmega_common/Makefile.include diff --git a/cpu/atmega2560/Makefile.include b/cpu/atmega2560/Makefile.include index 07c5448328..674831f872 100644 --- a/cpu/atmega2560/Makefile.include +++ b/cpu/atmega2560/Makefile.include @@ -1,13 +1,5 @@ -# tell the build system that the CPU depends on the atmega common files -USEMODULE += atmega_common - RAM_LEN = 8K ROM_LEN = 256K -# expand atmega_pcint with additional PCINTs for atmega2560 -ifneq (,$(filter atmega_pcint,$(USEMODULE))) - USEMODULE += atmega_pcint1 atmega_pcint2 -endif - # CPU depends on the atmega common module, so include it include $(RIOTCPU)/atmega_common/Makefile.include diff --git a/cpu/atmega256rfr2/Makefile.include b/cpu/atmega256rfr2/Makefile.include index 43c5888c1d..92250fe3c3 100644 --- a/cpu/atmega256rfr2/Makefile.include +++ b/cpu/atmega256rfr2/Makefile.include @@ -1,13 +1,5 @@ -# tell the build system that the CPU depends on the atmega common files -USEMODULE += atmega_common - RAM_LEN = 32K ROM_LEN = 256K -# expand atmega_pcint for atmega256rfr2 -ifneq (,$(filter atmega_pcint,$(USEMODULE))) - USEMODULE += atmega_pcint1 -endif - # CPU depends on the atmega common module, so include it include $(RIOTCPU)/atmega_common/Makefile.include diff --git a/cpu/atmega328p/Makefile.dep b/cpu/atmega328p/Makefile.dep new file mode 100644 index 0000000000..64d02fe932 --- /dev/null +++ b/cpu/atmega328p/Makefile.dep @@ -0,0 +1,6 @@ +# additional PCINTs for atmega328p +ifneq (,$(filter atmega_pcint,$(USEMODULE))) + USEMODULE += atmega_pcint1 atmega_pcint2 +endif + +include $(RIOTCPU)/atmega_common/Makefile.dep diff --git a/cpu/atmega328p/Makefile.include b/cpu/atmega328p/Makefile.include index 6c2b1845b9..0a24ecf028 100644 --- a/cpu/atmega328p/Makefile.include +++ b/cpu/atmega328p/Makefile.include @@ -1,13 +1,5 @@ -# tell the build system that the CPU depends on the atmega common files -USEMODULE += atmega_common - RAM_LEN = 2K ROM_LEN = 32K -# additional PCINTs for atmega328p -ifneq (,$(filter atmega_pcint,$(USEMODULE))) - USEMODULE += atmega_pcint1 atmega_pcint2 -endif - # CPU depends on the atmega common module, so include it include $(RIOTCPU)/atmega_common/Makefile.include diff --git a/cpu/atmega32u4/Makefile.include b/cpu/atmega32u4/Makefile.include index c767d1f12f..9638331d3f 100644 --- a/cpu/atmega32u4/Makefile.include +++ b/cpu/atmega32u4/Makefile.include @@ -1,9 +1,6 @@ # this CPU implementation is using the new core/CPU interface CFLAGS += -DCOREIF_NG=1 -# tell the build system that the CPU depends on the atmega common files -USEMODULE += atmega_common - # define path to atmega common module, which is needed for this CPU export ATMEGA_COMMON = $(RIOTCPU)/atmega_common/ diff --git a/cpu/atmega_common/Makefile.dep b/cpu/atmega_common/Makefile.dep index efee68f6f9..d418eb3b8f 100644 --- a/cpu/atmega_common/Makefile.dep +++ b/cpu/atmega_common/Makefile.dep @@ -1,3 +1,6 @@ +# tell the build system to build the atmega common files +USEMODULE += atmega_common + # expand atmega_pcint module ifneq (,$(filter atmega_pcint,$(USEMODULE))) USEMODULE += atmega_pcint0 diff --git a/cpu/atmega_common/Makefile.include b/cpu/atmega_common/Makefile.include index fe4ef3d9b9..188dc1466a 100644 --- a/cpu/atmega_common/Makefile.include +++ b/cpu/atmega_common/Makefile.include @@ -9,31 +9,4 @@ USEMODULE += avr_libc_extra PSEUDOMODULES += atmega_pcint PSEUDOMODULES += atmega_pcint% -# expand atmega_pcint module -# atmega16u4 only features atmega_pcint0, therefore additional pseudomodules -# are activated in each CPU's Makefile.include -ifneq (,$(filter atmega_pcint,$(USEMODULE))) - USEMODULE += atmega_pcint0 -endif - -# feature for atmega_pcint0 module -ifneq (,$(filter atmega_pcint0,$(USEMODULE))) - FEATURES_REQUIRED += atmega_pcint0 -endif - -# feature for atmega_pcint1 module -ifneq (,$(filter atmega_pcint1,$(USEMODULE))) - FEATURES_REQUIRED += atmega_pcint1 -endif - -# feature for atmega_pcint2 module -ifneq (,$(filter atmega_pcint2,$(USEMODULE))) - FEATURES_REQUIRED += atmega_pcint2 -endif - -# feature for atmega_pcint3 module -ifneq (,$(filter atmega_pcint3,$(USEMODULE))) - FEATURES_REQUIRED += atmega_pcint3 -endif - include $(RIOTMAKE)/arch/atmega.inc.mk