Skip to content

Commit d51cfd1

Browse files
committed
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.
1 parent eb380d7 commit d51cfd1

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

stm/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ STMSRC=lib
1717
FATFSSRC=fatfs
1818
CC3KSRC=cc3k
1919
DFU=../tools/dfu.py
20-
OSC_VALUE=8000000
2120

2221
AS = arm-none-eabi-as
2322
CC = arm-none-eabi-gcc
2423
LD = arm-none-eabi-ld
2524
OBJCOPY = arm-none-eabi-objcopy
2625
SIZE = arm-none-eabi-size
2726

28-
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)
27+
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
2928
CFLAGS = -I. -I$(PY_SRC) -I$(FATFSSRC) -I$(CMSIS) -I$(STMSRC) -Wall -ansi -std=gnu99 $(CFLAGS_CORTEX_M4)
3029
#CFLAGS += -I$(STMOTGSRC) -DUSE_HOST_MODE -DUSE_OTG_MODE
3130

stm/lib/stm32f4xx.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
extern "C" {
5858
#endif /* __cplusplus */
5959

60+
// dpgeorge: we include mpconfigport.h here because it contains the settings for the STM
61+
#include "mpconfigport.h"
62+
6063
/** @addtogroup Library_configuration_section
6164
* @{
6265
*/

stm/mpconfigport.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ machine_float_t machine_sqrt(machine_float_t x);
2222

2323
// board specific definitions
2424

25+
// choose 1 of these boards
2526
//#define PYBOARD
2627
#define PYBOARD4
2728
//#define STM32F4DISC
29+
30+
#define STM32F40_41xxx
31+
#define USE_STDPERIPH_DRIVER
32+
#define HSE_VALUE (8000000)

0 commit comments

Comments
 (0)