From d367090c4479cfe3517ab9a35952542bc7d0af30 Mon Sep 17 00:00:00 2001 From: Kees Bakker <kees@sodaq.com> Date: Tue, 6 Sep 2016 21:03:30 +0200 Subject: [PATCH] cpu/sam21_common: remove define of LITTLE_ENDIAN This define conflicts with LITTLE_ENDIAN defined in include/machine/endian.h which is part of gcc-arm-none-eabi. Also, the define does not seem to be used by the ASF included files. --- cpu/sam21_common/include/cmsis/samr21/README.md | 12 ++++++++++++ .../include/cmsis/samr21/include/samr21e16a.h | 1 - .../include/cmsis/samr21/include/samr21e17a.h | 1 - .../include/cmsis/samr21/include/samr21e18a.h | 1 - .../include/cmsis/samr21/include/samr21g16a.h | 1 - .../include/cmsis/samr21/include/samr21g17a.h | 1 - .../include/cmsis/samr21/include/samr21g18a.h | 1 - 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cpu/sam21_common/include/cmsis/samr21/README.md b/cpu/sam21_common/include/cmsis/samr21/README.md index 9c9ff143b8..fd622f3b55 100644 --- a/cpu/sam21_common/include/cmsis/samr21/README.md +++ b/cpu/sam21_common/include/cmsis/samr21/README.md @@ -13,3 +13,15 @@ the trailing white space had to be removed. Please take this into account when comparing to the original ASF distribution. find include/ -name '*.h' -exec sed -i 's/\s*$//' '{}' + + +## LITTLE_ENDIAN + +These include files define `LITTLE_ENDIAN`. But we think this is wrong. It +seems more logical to let the compiler decide in which mode the ARM code is +to be translated. In include/machine/endian.h there is already a define of +`LITTLE_ENDIAN` (and `BIG_ENDIAN`) for a different purpose. + +So, we decided to remove the define from the ASF CMSIS files. The command +for it (running from this directory) is: + + find include/ -name '*.h' -exec sed -i '/^#define\s\s*LITTLE_ENDIAN/d' '{}' + diff --git a/cpu/sam21_common/include/cmsis/samr21/include/samr21e16a.h b/cpu/sam21_common/include/cmsis/samr21/include/samr21e16a.h index 931bafca9c..88be0a31ef 100644 --- a/cpu/sam21_common/include/cmsis/samr21/include/samr21e16a.h +++ b/cpu/sam21_common/include/cmsis/samr21/include/samr21e16a.h @@ -229,7 +229,6 @@ void I2S_Handler ( void ); * \brief Configuration of the Cortex-M0+ Processor and Core Peripherals */ -#define LITTLE_ENDIAN 1 #define __CM0PLUS_REV 1 /*!< Core revision r0p1 */ #define __MPU_PRESENT 0 /*!< MPU present or not */ #define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */ diff --git a/cpu/sam21_common/include/cmsis/samr21/include/samr21e17a.h b/cpu/sam21_common/include/cmsis/samr21/include/samr21e17a.h index 38d7a98c75..8e42ec2da3 100644 --- a/cpu/sam21_common/include/cmsis/samr21/include/samr21e17a.h +++ b/cpu/sam21_common/include/cmsis/samr21/include/samr21e17a.h @@ -229,7 +229,6 @@ void I2S_Handler ( void ); * \brief Configuration of the Cortex-M0+ Processor and Core Peripherals */ -#define LITTLE_ENDIAN 1 #define __CM0PLUS_REV 1 /*!< Core revision r0p1 */ #define __MPU_PRESENT 0 /*!< MPU present or not */ #define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */ diff --git a/cpu/sam21_common/include/cmsis/samr21/include/samr21e18a.h b/cpu/sam21_common/include/cmsis/samr21/include/samr21e18a.h index 6bae1e0e0a..ebaf8fb988 100644 --- a/cpu/sam21_common/include/cmsis/samr21/include/samr21e18a.h +++ b/cpu/sam21_common/include/cmsis/samr21/include/samr21e18a.h @@ -229,7 +229,6 @@ void I2S_Handler ( void ); * \brief Configuration of the Cortex-M0+ Processor and Core Peripherals */ -#define LITTLE_ENDIAN 1 #define __CM0PLUS_REV 1 /*!< Core revision r0p1 */ #define __MPU_PRESENT 0 /*!< MPU present or not */ #define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */ diff --git a/cpu/sam21_common/include/cmsis/samr21/include/samr21g16a.h b/cpu/sam21_common/include/cmsis/samr21/include/samr21g16a.h index 5a51cc15ab..5e60e728ca 100644 --- a/cpu/sam21_common/include/cmsis/samr21/include/samr21g16a.h +++ b/cpu/sam21_common/include/cmsis/samr21/include/samr21g16a.h @@ -229,7 +229,6 @@ void I2S_Handler ( void ); * \brief Configuration of the Cortex-M0+ Processor and Core Peripherals */ -#define LITTLE_ENDIAN 1 #define __CM0PLUS_REV 1 /*!< Core revision r0p1 */ #define __MPU_PRESENT 0 /*!< MPU present or not */ #define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */ diff --git a/cpu/sam21_common/include/cmsis/samr21/include/samr21g17a.h b/cpu/sam21_common/include/cmsis/samr21/include/samr21g17a.h index 1f7ed0341c..fde6b89fe6 100644 --- a/cpu/sam21_common/include/cmsis/samr21/include/samr21g17a.h +++ b/cpu/sam21_common/include/cmsis/samr21/include/samr21g17a.h @@ -229,7 +229,6 @@ void I2S_Handler ( void ); * \brief Configuration of the Cortex-M0+ Processor and Core Peripherals */ -#define LITTLE_ENDIAN 1 #define __CM0PLUS_REV 1 /*!< Core revision r0p1 */ #define __MPU_PRESENT 0 /*!< MPU present or not */ #define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */ diff --git a/cpu/sam21_common/include/cmsis/samr21/include/samr21g18a.h b/cpu/sam21_common/include/cmsis/samr21/include/samr21g18a.h index 00ac5f292e..28cd2a3eaa 100644 --- a/cpu/sam21_common/include/cmsis/samr21/include/samr21g18a.h +++ b/cpu/sam21_common/include/cmsis/samr21/include/samr21g18a.h @@ -229,7 +229,6 @@ void I2S_Handler ( void ); * \brief Configuration of the Cortex-M0+ Processor and Core Peripherals */ -#define LITTLE_ENDIAN 1 #define __CM0PLUS_REV 1 /*!< Core revision r0p1 */ #define __MPU_PRESENT 0 /*!< MPU present or not */ #define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */ -- GitLab