diff --git a/cpu/cc2538/include/cpu_conf.h b/cpu/cc2538/include/cpu_conf.h index 088cdb4effaa810f63c1b34138eb6c3e9a6db6b9..4a34f3f3d9d30ce43afc31fa62627cc85f1d811d 100644 --- a/cpu/cc2538/include/cpu_conf.h +++ b/cpu/cc2538/include/cpu_conf.h @@ -19,6 +19,7 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" #include "cc2538.h" #include "cc2538_gpio.h" #include "cc2538_uart.h" diff --git a/cpu/cortexm_common/include/cpu.h b/cpu/cortexm_common/include/cpu.h index fbffb0f2da85037deb09c987de4b767dd0ea78a7..5f51eeec4e94febe504fa4860662d5c4478b2aa4 100644 --- a/cpu/cortexm_common/include/cpu.h +++ b/cpu/cortexm_common/include/cpu.h @@ -39,40 +39,6 @@ extern "C" { #endif -/** - * @brief Configuration of default stack sizes - * - * As all members of the Cortex-M family behave identical in terms of stack - * usage, we define the default stack size values here centrally for all CPU - * implementations. - * - * If needed, you can overwrite these values the the `cpu_conf.h` file of the - * specific CPU implementation. - * - * @todo Adjust values for Cortex-M4F with FPU? - * @todo Configure second set if no newlib nano.specs are available? - * @{ - */ -#ifndef THREAD_EXTRA_STACKSIZE_PRINTF -#define THREAD_EXTRA_STACKSIZE_PRINTF (512) -#endif -#ifndef THREAD_STACKSIZE_DEFAULT -#define THREAD_STACKSIZE_DEFAULT (1024) -#endif -#ifndef THREAD_STACKSIZE_IDLE -#define THREAD_STACKSIZE_IDLE (256) -#endif -/** @} */ - -/** - * @brief Stack size used for the exception (ISR) stack - * @{ - */ -#ifndef ISR_STACKSIZE -#define ISR_STACKSIZE (512U) -#endif -/** @} */ - /** * @brief Some members of the Cortex-M family have architecture specific * atomic operations in atomic_arch.c diff --git a/cpu/cortexm_common/include/cpu_conf_common.h b/cpu/cortexm_common/include/cpu_conf_common.h new file mode 100644 index 0000000000000000000000000000000000000000..27a32ddd51b6078e851552c3887d3f8850c114e4 --- /dev/null +++ b/cpu/cortexm_common/include/cpu_conf_common.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @ingroup cpu_cortexm_common + * @{ + * + * @file + * @brief Common CPU definitione for Cortex-M family based MCUs + * + * @author Kaspar Schleiser <kaspar@schleiser.de> + */ + +#ifndef CPU_CONF_COMMON_H_ +#define CPU_CONF_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Configuration of default stack sizes + * + * As all members of the Cortex-M family behave identical in terms of stack + * usage, we define the default stack size values here centrally for all CPU + * implementations. + * + * If needed, you can overwrite these values the the `cpu_conf.h` file of the + * specific CPU implementation. + * + * @todo Adjust values for Cortex-M4F with FPU? + * @todo Configure second set if no newlib nano.specs are available? + * @{ + */ +#ifndef THREAD_EXTRA_STACKSIZE_PRINTF +#define THREAD_EXTRA_STACKSIZE_PRINTF (512) +#endif +#ifndef THREAD_STACKSIZE_DEFAULT +#define THREAD_STACKSIZE_DEFAULT (1024) +#endif +#ifndef THREAD_STACKSIZE_IDLE +#define THREAD_STACKSIZE_IDLE (256) +#endif +/** @} */ + +/** + * @brief Stack size used for the exception (ISR) stack + * @{ + */ +#ifndef ISR_STACKSIZE +#define ISR_STACKSIZE (512U) +#endif +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* CPU_CONF_COMMON_H_ */ +/** @} */ diff --git a/cpu/ezr32wg/include/cpu_conf.h b/cpu/ezr32wg/include/cpu_conf.h index c65a2712b34e1fdf212a8119f125b1779ea1063f..f0cb492e976f2f55fa84e7b3d98b36ea3f75b0fc 100644 --- a/cpu/ezr32wg/include/cpu_conf.h +++ b/cpu/ezr32wg/include/cpu_conf.h @@ -21,6 +21,8 @@ #ifndef CPU_CONF_H #define CPU_CONF_H +#include "cpu_conf_common.h" + #if (CPU_MODEL == ezr32wg330f256r60) #include "ezr32wg330f256r60.h" #else diff --git a/cpu/k60/include/cpu_conf.h b/cpu/k60/include/cpu_conf.h index 34fd5893f1eb52f5f63da9750a122b05137c33f1..e1e5dda7e79ef4dd8a0deef8ed1f7aa28b1c3fc8 100644 --- a/cpu/k60/include/cpu_conf.h +++ b/cpu/k60/include/cpu_conf.h @@ -21,6 +21,8 @@ #ifndef CPU_CONF_H_ #define CPU_CONF_H_ +#include "cpu_conf_common.h" + #ifdef __cplusplus extern "C" { diff --git a/cpu/k64f/include/cpu_conf.h b/cpu/k64f/include/cpu_conf.h index 9d38392ceb5677c2a60a36ca78fd399ac9a79815..3abb2381bde764b788fdff7aa65e11149f62a324 100644 --- a/cpu/k64f/include/cpu_conf.h +++ b/cpu/k64f/include/cpu_conf.h @@ -24,6 +24,8 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" + #ifdef CPU_MODEL_MK64FN1M0VLL12 #include "MK64F12.h" #else diff --git a/cpu/kw2x/include/cpu_conf.h b/cpu/kw2x/include/cpu_conf.h index 3ec3c1e00e5700b5f0bd62570ba1428b0b0dd3c8..c6f46f20ba4bc0b064f4cbdd4c66fc7d34c0e831 100644 --- a/cpu/kw2x/include/cpu_conf.h +++ b/cpu/kw2x/include/cpu_conf.h @@ -25,6 +25,8 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" + #ifdef CPU_MODEL_KW21D256 #include "MKW22D5.h" #elif CPU_MODEL_KW21D512 diff --git a/cpu/lm4f120/include/cpu_conf.h b/cpu/lm4f120/include/cpu_conf.h index 4fe073ecfd2d17dc60692e7899271f673ba54409..86c0b5ec64261865724b1ae04a2667166dbd7c9b 100644 --- a/cpu/lm4f120/include/cpu_conf.h +++ b/cpu/lm4f120/include/cpu_conf.h @@ -21,6 +21,7 @@ #ifndef CPU_CONF_H #define CPU_CONF_H +#include "cpu_conf_common.h" #include <stdio.h> #include <stdlib.h> diff --git a/cpu/lpc11u34/include/cpu_conf.h b/cpu/lpc11u34/include/cpu_conf.h index e5a276b0c07962499ba0db27e246383561f9f526..faecfc1e4eea75eab977f3de5bcce2275f423023 100644 --- a/cpu/lpc11u34/include/cpu_conf.h +++ b/cpu/lpc11u34/include/cpu_conf.h @@ -21,6 +21,8 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" + #include "LPC11Uxx.h" #ifdef __cplusplus diff --git a/cpu/lpc1768/include/cpu_conf.h b/cpu/lpc1768/include/cpu_conf.h index 813f90173116728970185fc5da5b758c5dcd02fd..adb7d685e97eb1bcfa1ab57f7c32a82ae1a23223 100644 --- a/cpu/lpc1768/include/cpu_conf.h +++ b/cpu/lpc1768/include/cpu_conf.h @@ -21,6 +21,8 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" + #include "LPC17xx.h" #ifdef __cplusplus diff --git a/cpu/nrf51/include/cpu_conf.h b/cpu/nrf51/include/cpu_conf.h index 93b93e040250eab4ff417164d27046480085e50b..1c582677d67aee16ac5a7a7131947befc58e2a21 100644 --- a/cpu/nrf51/include/cpu_conf.h +++ b/cpu/nrf51/include/cpu_conf.h @@ -19,6 +19,7 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" #include "nrf51.h" #include "nrf51_bitfields.h" diff --git a/cpu/nrf52/include/cpu_conf.h b/cpu/nrf52/include/cpu_conf.h index 413ce54932972b66b4be10776f041c4898173a3f..066b1cfbcac7258015ed753084c37ced470fa3da 100644 --- a/cpu/nrf52/include/cpu_conf.h +++ b/cpu/nrf52/include/cpu_conf.h @@ -20,6 +20,7 @@ #ifndef CPU_CONF_H #define CPU_CONF_H +#include "cpu_conf_common.h" #include "nrf52.h" #include "nrf52_bitfields.h" diff --git a/cpu/sam3/include/cpu_conf.h b/cpu/sam3/include/cpu_conf.h index 0debff6c0222a390d67f71453509e561d8edc700..f3219f397dd3af9a9388ae07a68bba4f4d5cbdc5 100644 --- a/cpu/sam3/include/cpu_conf.h +++ b/cpu/sam3/include/cpu_conf.h @@ -21,6 +21,7 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" #include "sam3x8e.h" #ifdef __cplusplus diff --git a/cpu/samd21/include/cpu_conf.h b/cpu/samd21/include/cpu_conf.h index 1b7324fa01310515af33ca2f74b1a6e04f27878c..8ce539c9cd70a5dda90213aabf7e50195da7b007 100644 --- a/cpu/samd21/include/cpu_conf.h +++ b/cpu/samd21/include/cpu_conf.h @@ -18,6 +18,8 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" + #include "samd21.h" #ifdef __cplusplus diff --git a/cpu/saml21/include/cpu_conf.h b/cpu/saml21/include/cpu_conf.h index d76423f100a0cd265c61b891d12ff87055d16a02..fb0e41f7fb3506f15fe14b3e0b43085add759d74 100644 --- a/cpu/saml21/include/cpu_conf.h +++ b/cpu/saml21/include/cpu_conf.h @@ -18,6 +18,8 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" + #include "atmel/saml21.h" #ifdef __cplusplus diff --git a/cpu/stm32f0/include/cpu_conf.h b/cpu/stm32f0/include/cpu_conf.h index d99e8b5211363938ce2e95338df11ea1c743305f..b12c10397147d76a692f0fd0a285e818f23df63e 100644 --- a/cpu/stm32f0/include/cpu_conf.h +++ b/cpu/stm32f0/include/cpu_conf.h @@ -21,6 +21,8 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" + #ifdef CPU_MODEL_STM32F051R8 #include "stm32f051x8.h" #endif diff --git a/cpu/stm32f1/include/cpu_conf.h b/cpu/stm32f1/include/cpu_conf.h index 02ae4a9da87f494e34a2f640afcd6fa7e84a0060..f199af8fe8c5ba000eca8c7e5427fad048161114 100644 --- a/cpu/stm32f1/include/cpu_conf.h +++ b/cpu/stm32f1/include/cpu_conf.h @@ -23,6 +23,8 @@ #ifndef CPU_CONF_H #define CPU_CONF_H +#include "cpu_conf_common.h" + #if defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB) #include "stm32f103xb.h" #elif defined(CPU_MODEL_STM32F103RE) diff --git a/cpu/stm32f3/include/cpu_conf.h b/cpu/stm32f3/include/cpu_conf.h index 59b05070eb3722b2a204b685e0cf5d2aad6b59e0..87026b3de699c8d86960f1b039f98298f5e147a1 100644 --- a/cpu/stm32f3/include/cpu_conf.h +++ b/cpu/stm32f3/include/cpu_conf.h @@ -22,6 +22,8 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" + #ifdef CPU_MODEL_STM32F303VC #include "stm32f303xc.h" #endif diff --git a/cpu/stm32f4/include/cpu_conf.h b/cpu/stm32f4/include/cpu_conf.h index ab99da295eaeb63b4780ce8e29662b22856e1ff9..bdeee66ac27c83ab81d6bb9253b0c364386348cd 100644 --- a/cpu/stm32f4/include/cpu_conf.h +++ b/cpu/stm32f4/include/cpu_conf.h @@ -21,6 +21,8 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H +#include "cpu_conf_common.h" + #if defined(CPU_MODEL_STM32F401RE) #include "stm32f401xe.h" #elif defined(CPU_MODEL_STM32F407VG) diff --git a/cpu/stm32l1/include/cpu_conf.h b/cpu/stm32l1/include/cpu_conf.h index 1520a9b2590b23c91f7fa585a8fd7bc22f55b3ff..3214ccce8c1374ce9e5cc59d7459aa37633f5345 100644 --- a/cpu/stm32l1/include/cpu_conf.h +++ b/cpu/stm32l1/include/cpu_conf.h @@ -21,6 +21,8 @@ #ifndef CPUCONF_H_ #define CPUCONF_H_ +#include "cpu_conf_common.h" + #include "stm32l1xx.h" #ifdef __cplusplus