diff options
author | Karel Kočí <cynerd@email.cz> | 2015-03-22 14:26:37 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-03-22 14:26:37 +0100 |
commit | 710c457afeb7b8132000071468b147ab8c3f8612 (patch) | |
tree | 63b77aaa64dc9956ef8728fef6783da865d5cc36 | |
parent | 996eb9e0fc20de09af8e9a4f3427f08e72bcdb1d (diff) | |
download | avr-ioe-710c457afeb7b8132000071468b147ab8c3f8612.tar.gz avr-ioe-710c457afeb7b8132000071468b147ab8c3f8612.tar.bz2 avr-ioe-710c457afeb7b8132000071468b147ab8c3f8612.zip |
Moving mcu grouping to separate header
mcu.h is from now for mcu groups defines.
mcu_def now doing same as mcu.h previous.
-rw-r--r-- | mcu/mcu.h | 24 | ||||
-rw-r--r-- | mcu/mcu_def.h | 17 | ||||
-rw-r--r-- | src/spi.c | 2 | ||||
-rw-r--r-- | src/spi_usart.c | 2 | ||||
-rw-r--r-- | src/spi_usi.c | 2 |
5 files changed, 30 insertions, 17 deletions
@@ -1,19 +1,15 @@ -#if (defined __AVR_ATmega328P__ || defined __AVR_ATmega328__ || \ +#define __MCU_ATmega328p__ \ + ((defined __AVR_ATmega328P__ || defined __AVR_ATmega328__ || \ defined __AVR_ATmega1688PA__ || defined __AVR_ATmega168A__ || \ defined __AVR_ATmega88PA__ || defined __AVR_ATmega88A__ || \ - defined __AVR_ATmega48PA__ || defined AVR_ATmega48A__) -#include "ATmega328P.h" -#endif + defined __AVR_ATmega48PA__ || defined AVR_ATmega48A__)) -#if (defined __AVR_ATmega328U4__ || defined __AVR_ATmega16U4) -#include "ATmega32U4.h" -#endif +#define __MCU_ATmega32U4__ \ + ((defined __AVR_ATmega32U4__ || defined __AVR_ATmega16U4)) -#if (defined __AVR_ATtiny4313__ || defined __AVR_ATtiny2313A__) -#include "ATtiny4313.h" -#endif +#define __MCU_ATtiny4313__ \ + ((defined __AVR_ATtiny4313__ || defined __AVR_ATtiny2313A__)) -#if (defined __AVR_ATtiny85__ || defined __AVR_ATtiny45__ || \ - defined __AVR_ATtiny25__) -#include "ATtiny85.h" -#endif +#define __MCU_ATtiny85__ \ + ((defined __AVR_ATtiny85__ || defined __AVR_ATtiny45__ || \ + defined __AVR_ATtiny25__)) diff --git a/mcu/mcu_def.h b/mcu/mcu_def.h new file mode 100644 index 0000000..b423a77 --- /dev/null +++ b/mcu/mcu_def.h @@ -0,0 +1,17 @@ +#include "mcu.h" + +#if __MCU_ATmega328p__ +#include "ATmega328P.h" +#endif + +#if __MCU_ATmega32U4__ +#include "ATmega32U4.h" +#endif + +#if __MCU_ATtiny4313__ +#include "ATtiny4313.h" +#endif + +#if __MCU_ATtiny85__ +#include "ATtiny85.h" +#endif @@ -1,5 +1,5 @@ #include "../spi.h" -#include "mcu/mcu.h" +#include "mcu/mcu_def.h" inline void ioe_spi_join(void) { // TODO diff --git a/src/spi_usart.c b/src/spi_usart.c index 40eb06d..2e5d612 100644 --- a/src/spi_usart.c +++ b/src/spi_usart.c @@ -1,5 +1,5 @@ #include "../spi_usart.h" -#include "mcu/mcu.h" +#include "../mcu/mcu_def.h" inline void ioe_spi_usart_init(void) { } diff --git a/src/spi_usi.c b/src/spi_usi.c index 7bdb5c2..8baa8e2 100644 --- a/src/spi_usi.c +++ b/src/spi_usi.c @@ -1,5 +1,5 @@ #include "../spi_usi.h" -#include "../mcu/mcu.h" +#include "../mcu/mcu_def.h" #ifdef IOE_SPI_USI_MASTER |