From d51cfd155c09771a6abb4e7a058522f4677fc7cb Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Tue, 21 Jan 2014 22:32:51 +0000
Subject: [PATCH] stm: Put HSE_VALUE and other defines in mpconfigport.h.

mpconfigport.h is now included by stm32f4xx.h so that all STM files have
access to these defines.
---
 stm/Makefile        | 3 +--
 stm/lib/stm32f4xx.h | 3 +++
 stm/mpconfigport.h  | 5 +++++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/stm/Makefile b/stm/Makefile
index 75fdee7c6..8b9e98fa0 100644
--- a/stm/Makefile
+++ b/stm/Makefile
@@ -17,7 +17,6 @@ STMSRC=lib
 FATFSSRC=fatfs
 CC3KSRC=cc3k
 DFU=../tools/dfu.py
-OSC_VALUE=8000000
 
 AS = arm-none-eabi-as
 CC = arm-none-eabi-gcc
@@ -25,7 +24,7 @@ LD = arm-none-eabi-ld
 OBJCOPY = arm-none-eabi-objcopy
 SIZE = arm-none-eabi-size
 
-CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion -DSTM32F40_41xxx -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=$(OSC_VALUE)
+CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion
 CFLAGS = -I. -I$(PY_SRC) -I$(FATFSSRC) -I$(CMSIS) -I$(STMSRC) -Wall -ansi -std=gnu99 $(CFLAGS_CORTEX_M4)
 #CFLAGS += -I$(STMOTGSRC) -DUSE_HOST_MODE -DUSE_OTG_MODE
 
diff --git a/stm/lib/stm32f4xx.h b/stm/lib/stm32f4xx.h
index eca261691..22b47f6b2 100644
--- a/stm/lib/stm32f4xx.h
+++ b/stm/lib/stm32f4xx.h
@@ -57,6 +57,9 @@
  extern "C" {
 #endif /* __cplusplus */
   
+// dpgeorge: we include mpconfigport.h here because it contains the settings for the STM
+#include "mpconfigport.h"
+
 /** @addtogroup Library_configuration_section
   * @{
   */
diff --git a/stm/mpconfigport.h b/stm/mpconfigport.h
index 2d9eba1f4..3577918be 100644
--- a/stm/mpconfigport.h
+++ b/stm/mpconfigport.h
@@ -22,6 +22,11 @@ machine_float_t machine_sqrt(machine_float_t x);
 
 // board specific definitions
 
+// choose 1 of these boards
 //#define PYBOARD
 #define PYBOARD4
 //#define STM32F4DISC
+
+#define STM32F40_41xxx
+#define USE_STDPERIPH_DRIVER
+#define HSE_VALUE (8000000)
-- 
GitLab