cpu: cortexm*: move cpu_conf.h stuff from cpu.h into cpu_conf_common.h

This commit is contained in:
Kaspar Schleiser 2016-01-14 23:21:49 +01:00
parent 2b010b5337
commit 6881f65f46
20 changed files with 96 additions and 34 deletions

View File

@ -19,6 +19,7 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#include "cc2538.h" #include "cc2538.h"
#include "cc2538_gpio.h" #include "cc2538_gpio.h"
#include "cc2538_uart.h" #include "cc2538_uart.h"

View File

@ -39,40 +39,6 @@
extern "C" { extern "C" {
#endif #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 * @brief Some members of the Cortex-M family have architecture specific
* atomic operations in atomic_arch.c * atomic operations in atomic_arch.c

View File

@ -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_ */
/** @} */

View File

@ -21,6 +21,8 @@
#ifndef CPU_CONF_H #ifndef CPU_CONF_H
#define CPU_CONF_H #define CPU_CONF_H
#include "cpu_conf_common.h"
#if (CPU_MODEL == ezr32wg330f256r60) #if (CPU_MODEL == ezr32wg330f256r60)
#include "ezr32wg330f256r60.h" #include "ezr32wg330f256r60.h"
#else #else

View File

@ -21,6 +21,8 @@
#ifndef CPU_CONF_H_ #ifndef CPU_CONF_H_
#define CPU_CONF_H_ #define CPU_CONF_H_
#include "cpu_conf_common.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {

View File

@ -24,6 +24,8 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#ifdef CPU_MODEL_MK64FN1M0VLL12 #ifdef CPU_MODEL_MK64FN1M0VLL12
#include "MK64F12.h" #include "MK64F12.h"
#else #else

View File

@ -25,6 +25,8 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#ifdef CPU_MODEL_KW21D256 #ifdef CPU_MODEL_KW21D256
#include "MKW22D5.h" #include "MKW22D5.h"
#elif CPU_MODEL_KW21D512 #elif CPU_MODEL_KW21D512

View File

@ -21,6 +21,7 @@
#ifndef CPU_CONF_H #ifndef CPU_CONF_H
#define CPU_CONF_H #define CPU_CONF_H
#include "cpu_conf_common.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -21,6 +21,8 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#include "LPC11Uxx.h" #include "LPC11Uxx.h"
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -21,6 +21,8 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#include "LPC17xx.h" #include "LPC17xx.h"
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -19,6 +19,7 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#include "nrf51.h" #include "nrf51.h"
#include "nrf51_bitfields.h" #include "nrf51_bitfields.h"

View File

@ -20,6 +20,7 @@
#ifndef CPU_CONF_H #ifndef CPU_CONF_H
#define CPU_CONF_H #define CPU_CONF_H
#include "cpu_conf_common.h"
#include "nrf52.h" #include "nrf52.h"
#include "nrf52_bitfields.h" #include "nrf52_bitfields.h"

View File

@ -21,6 +21,7 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#include "sam3x8e.h" #include "sam3x8e.h"
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -18,6 +18,8 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#include "samd21.h" #include "samd21.h"
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -18,6 +18,8 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#include "atmel/saml21.h" #include "atmel/saml21.h"
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -21,6 +21,8 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#ifdef CPU_MODEL_STM32F051R8 #ifdef CPU_MODEL_STM32F051R8
#include "stm32f051x8.h" #include "stm32f051x8.h"
#endif #endif

View File

@ -23,6 +23,8 @@
#ifndef CPU_CONF_H #ifndef CPU_CONF_H
#define CPU_CONF_H #define CPU_CONF_H
#include "cpu_conf_common.h"
#if defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB) #if defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB)
#include "stm32f103xb.h" #include "stm32f103xb.h"
#elif defined(CPU_MODEL_STM32F103RE) #elif defined(CPU_MODEL_STM32F103RE)

View File

@ -22,6 +22,8 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#ifdef CPU_MODEL_STM32F303VC #ifdef CPU_MODEL_STM32F303VC
#include "stm32f303xc.h" #include "stm32f303xc.h"
#endif #endif

View File

@ -21,6 +21,8 @@
#ifndef __CPU_CONF_H #ifndef __CPU_CONF_H
#define __CPU_CONF_H #define __CPU_CONF_H
#include "cpu_conf_common.h"
#if defined(CPU_MODEL_STM32F401RE) #if defined(CPU_MODEL_STM32F401RE)
#include "stm32f401xe.h" #include "stm32f401xe.h"
#elif defined(CPU_MODEL_STM32F407VG) #elif defined(CPU_MODEL_STM32F407VG)

View File

@ -21,6 +21,8 @@
#ifndef CPUCONF_H_ #ifndef CPUCONF_H_
#define CPUCONF_H_ #define CPUCONF_H_
#include "cpu_conf_common.h"
#include "stm32l1xx.h" #include "stm32l1xx.h"
#ifdef __cplusplus #ifdef __cplusplus