stm32: rename __ARM_STM32F411__ to __ARM_STM32__

This commit is contained in:
Nico Tonnhofer 2017-07-24 00:14:46 +02:00
parent bd5bfb3d76
commit b62bad1b0a
15 changed files with 25 additions and 25 deletions

View File

@ -142,7 +142,7 @@ ifeq ($(MCU), lpc1114)
else ifeq ($(findstring stm32, $(MCU)), stm32) else ifeq ($(findstring stm32, $(MCU)), stm32)
CFLAGS += -mthumb -mcpu=cortex-m4 CFLAGS += -mthumb -mcpu=cortex-m4
CFLAGS += -mtune=cortex-m4 CFLAGS += -mtune=cortex-m4
CFLAGS += -D__ARM_STM32F411__ CFLAGS += -D__ARM_STM32__
CFLAGS += -mfpu=fpv4-sp-d16 CFLAGS += -mfpu=fpv4-sp-d16
CFLAGS += -mfloat-abi=hard CFLAGS += -mfloat-abi=hard
CFLAGS += -mlittle-endian CFLAGS += -mlittle-endian

View File

@ -5,7 +5,7 @@
each channel. We are using DMA instead. each channel. We are using DMA instead.
*/ */
#if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ #if defined TEACUP_C_INCLUDE && defined __ARM_STM32__
#include "cmsis-stm32f4xx.h" #include "cmsis-stm32f4xx.h"
#include "arduino.h" #include "arduino.h"
@ -215,4 +215,4 @@ void start_adc() {
ADC_CR2_SWSTART; ADC_CR2_SWSTART;
} }
#endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ */ #endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32__ */

View File

@ -6,7 +6,7 @@
#include "analog.h" #include "analog.h"
#include "temp.h" #include "temp.h"
#ifndef __ARM_STM32F411__ #ifndef __ARM_STM32__
/** /**
OR-combined mask of all channels. Auto-magically generated from OR-combined mask of all channels. Auto-magically generated from
DEFINE_TEMP_SENSOR() entries in config_wrapper.h DEFINE_TEMP_SENSOR() entries in config_wrapper.h

View File

@ -57,9 +57,9 @@
#define NEEDS_START_ADC #define NEEDS_START_ADC
/* #endif __AVR__ */ /* #endif __AVR__ */
#elif __ARM_STM32F411__ #elif __ARM_STM32__
#define NEEDS_START_ADC #define NEEDS_START_ADC
#endif /* __ARM_STM32F411__ */ #endif /* __ARM_STM32__ */
void analog_init(void); void analog_init(void);

View File

@ -73,7 +73,7 @@
#include "arduino_lpc1114.h" #include "arduino_lpc1114.h"
#endif #endif
#if defined (__ARM_STM32F411__) #if defined (__ARM_STM32__)
#include "arduino_stm32f411.h" #include "arduino_stm32f411.h"
#endif #endif

View File

@ -73,13 +73,13 @@
- Prefixed names of #include files with mbed- to match the names of the - Prefixed names of #include files with mbed- to match the names of the
copies in the Teacup repo. copies in the Teacup repo.
- Wrapped the whole file in #ifdef __ARM_STM32F411__ to not cause conflicts with - Wrapped the whole file in #ifdef __ARM_STM32__ to not cause conflicts with
AVR builds. AVR builds.
- Rebuild SystemInit() and SetSysClock() to get rid of most mbed-files. Please take a look into history. - Rebuild SystemInit() and SetSysClock() to get rid of most mbed-files. Please take a look into history.
- Rework SetSysClock completely - Rework SetSysClock completely
*/ */
#ifdef __ARM_STM32F411__ #ifdef __ARM_STM32__
#include "cmsis-stm32f4xx.h" #include "cmsis-stm32f4xx.h"
#include "arduino_stm32f411.h" #include "arduino_stm32f411.h"

View File

@ -5,7 +5,7 @@
To be included from cpu.c, for details see there. To be included from cpu.c, for details see there.
*/ */
#if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ #if defined TEACUP_C_INCLUDE && defined __ARM_STM32__
#include "config_wrapper.h" #include "config_wrapper.h"
@ -21,4 +21,4 @@ void cpu_init() {
RCC_AHB1ENR_GPIOHEN; RCC_AHB1ENR_GPIOHEN;
} }
#endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ */ #endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32__ */

2
cpu.h
View File

@ -10,7 +10,7 @@
#include "cmsis-lpc11xx.h" // For __ASM(). #include "cmsis-lpc11xx.h" // For __ASM().
#elif defined __ARM_STM32F411__ #elif defined __ARM_STM32__
#include "cmsis-stm32f4xx.h" // For __ASM(). #include "cmsis-stm32f4xx.h" // For __ASM().

View File

@ -3,7 +3,7 @@
\brief Delay routines, ARM specific part. \brief Delay routines, ARM specific part.
*/ */
#if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ #if defined TEACUP_C_INCLUDE && defined __ARM_STM32__
#include "cmsis-stm32f4xx.h" // For __ASM() and ... #include "cmsis-stm32f4xx.h" // For __ASM() and ...
@ -47,4 +47,4 @@ void delay_us(uint16_t delay) {
} }
} }
#endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ */ #endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32__ */

View File

@ -3,7 +3,7 @@
\brief Manage heaters, including PID and PWM, ARM specific part. \brief Manage heaters, including PID and PWM, ARM specific part.
*/ */
#if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ #if defined TEACUP_C_INCLUDE && defined __ARM_STM32__
#include "cmsis-stm32f4xx.h" #include "cmsis-stm32f4xx.h"
#include "pinio.h" #include "pinio.h"
@ -262,4 +262,4 @@ void do_heater(heater_t index, uint8_t value) {
} }
} }
#endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ */ #endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32__ */

View File

@ -114,7 +114,7 @@
LPC_IOCON->IO ## _CMSIS = (IO ## _OUTPUT | IO_MODEMASK_INACTIVE); \ LPC_IOCON->IO ## _CMSIS = (IO ## _OUTPUT | IO_MODEMASK_INACTIVE); \
} while (0) } while (0)
#elif defined __ARM_STM32F411__ #elif defined __ARM_STM32__
/// Read a pin. /// Read a pin.
#define _READ(IO) (IO ## _PORT->IDR & MASK(IO ## _PIN)) #define _READ(IO) (IO ## _PORT->IDR & MASK(IO ## _PIN))
/// Write to a pin. /// Write to a pin.
@ -213,7 +213,7 @@
#define _PULLUP_ON(IO) _WRITE(IO, 1) #define _PULLUP_ON(IO) _WRITE(IO, 1)
#define _PULL_OFF(IO) _WRITE(IO, 0) #define _PULL_OFF(IO) _WRITE(IO, 0)
#endif /* __AVR__, __ARM_LPC1114__, __ARM_STM32F411__, SIMULATOR */ #endif /* __AVR__, __ARM_LPC1114__, __ARM_STM32__, SIMULATOR */
/** /**
Why double up on these macros? Why double up on these macros?

View File

@ -10,7 +10,7 @@
Code here is heavily inspired by serial_api.c of MBED Code here is heavily inspired by serial_api.c of MBED
*/ */
#if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ #if defined TEACUP_C_INCLUDE && defined __ARM_STM32__
#include "arduino.h" #include "arduino.h"
#include "pinio.h" #include "pinio.h"
@ -214,4 +214,4 @@ void serial_writechar(uint8_t data) {
uartx_writechar(UART_SERIAL, data); uartx_writechar(UART_SERIAL, data);
} }
#endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ */ #endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32__ */

View File

@ -3,7 +3,7 @@
\brief SPI routines, STM32F411 specific part. \brief SPI routines, STM32F411 specific part.
*/ */
#if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ #if defined TEACUP_C_INCLUDE && defined __ARM_STM32__
/** Initialise SPI subsystem. /** Initialise SPI subsystem.
@ -130,4 +130,4 @@ void spi_speed_max() {
SPI2->CR1 |= SPI_CR1_BR_1 | SPI_CR1_BR_0; // 1/16 -> SPI2 = 3.125MHz SPI2->CR1 |= SPI_CR1_BR_1 | SPI_CR1_BR_0; // 1/16 -> SPI2 = 3.125MHz
} }
#endif /* TEACUP_C_INCLUDE && defined __ARM_STM32F411__ */ #endif /* TEACUP_C_INCLUDE && defined __ARM_STM32__ */

2
spi.h
View File

@ -121,7 +121,7 @@ inline uint8_t spi_rw(uint8_t byte) {
return SPDR; return SPDR;
} }
#elif defined __ARM_STM32F411__ #elif defined __ARM_STM32__
void spi_speed_100_400(void); void spi_speed_100_400(void);
void spi_speed_max(void); void spi_speed_max(void);

View File

@ -5,7 +5,7 @@
To be included from timer.c. To be included from timer.c.
*/ */
#if defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ #if defined TEACUP_C_INCLUDE && defined __ARM_STM32__
#include "cmsis-core_cm4.h" #include "cmsis-core_cm4.h"
#include "clock.h" #include "clock.h"
@ -226,4 +226,4 @@ void timer_stop() {
SysTick->CTRL = 0; SysTick->CTRL = 0;
} }
#endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32F411__ */ #endif /* defined TEACUP_C_INCLUDE && defined __ARM_STM32__ */