From 6881f65f46b43e6f7cc2ae0f84a7098d64333a93 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser <kaspar@schleiser.de> Date: Thu, 14 Jan 2016 23:21:49 +0100 Subject: [PATCH] cpu: cortexm*: move cpu_conf.h stuff from cpu.h into cpu_conf_common.h --- cpu/cc2538/include/cpu_conf.h | 1 + cpu/cortexm_common/include/cpu.h | 34 ---------- cpu/cortexm_common/include/cpu_conf_common.h | 65 ++++++++++++++++++++ cpu/ezr32wg/include/cpu_conf.h | 2 + cpu/k60/include/cpu_conf.h | 2 + cpu/k64f/include/cpu_conf.h | 2 + cpu/kw2x/include/cpu_conf.h | 2 + cpu/lm4f120/include/cpu_conf.h | 1 + cpu/lpc11u34/include/cpu_conf.h | 2 + cpu/lpc1768/include/cpu_conf.h | 2 + cpu/nrf51/include/cpu_conf.h | 1 + cpu/nrf52/include/cpu_conf.h | 1 + cpu/sam3/include/cpu_conf.h | 1 + cpu/samd21/include/cpu_conf.h | 2 + cpu/saml21/include/cpu_conf.h | 2 + cpu/stm32f0/include/cpu_conf.h | 2 + cpu/stm32f1/include/cpu_conf.h | 2 + cpu/stm32f3/include/cpu_conf.h | 2 + cpu/stm32f4/include/cpu_conf.h | 2 + cpu/stm32l1/include/cpu_conf.h | 2 + 20 files changed, 96 insertions(+), 34 deletions(-) create mode 100644 cpu/cortexm_common/include/cpu_conf_common.h diff --git a/cpu/cc2538/include/cpu_conf.h b/cpu/cc2538/include/cpu_conf.h index 088cdb4eff..4a34f3f3d9 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 fbffb0f2da..5f51eeec4e 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 0000000000..27a32ddd51 --- /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 c65a2712b3..f0cb492e97 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 34fd5893f1..e1e5dda7e7 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 9d38392ceb..3abb2381bd 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 3ec3c1e00e..c6f46f20ba 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 4fe073ecfd..86c0b5ec64 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 e5a276b0c0..faecfc1e4e 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 813f901731..adb7d685e9 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 93b93e0402..1c582677d6 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 413ce54932..066b1cfbca 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 0debff6c02..f3219f397d 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 1b7324fa01..8ce539c9cd 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 d76423f100..fb0e41f7fb 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 d99e8b5211..b12c103971 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 02ae4a9da8..f199af8fe8 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 59b05070eb..87026b3de6 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 ab99da295e..bdeee66ac2 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 1520a9b259..3214ccce8c 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 -- GitLab