Skip to content

Commit 0303f55

Browse files
authored
Prevent redefine of HSE_VALUE if already user-overridden (#1281)
* Prevent redefine of HSE_VALUE if already user-overridden Commercially sold Blackpill F411CE boards feature a 25MHz crystal, but if a board differs, HSE_VALUE can still be overridden while keeping everything else the same. With defensive programming like this, users of a custom (or differing commercially sold) board can easily use this variant with the same chip but just a slightly different crystal.
1 parent f4c200f commit 0303f55

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

variants/Generic_F401Cx/variant.h

+2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ extern "C" {
110110
#define PIN_SERIAL_TX PA9
111111

112112
#ifdef ARDUINO_BLACKPILL_F401CC
113+
#ifndef HSE_VALUE
113114
#define HSE_VALUE 25000000U
114115
#endif
116+
#endif
115117

116118
#ifdef __cplusplus
117119
} // extern "C"

variants/Generic_F411Cx/variant.h

+2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ extern "C" {
113113
#define PIN_SERIAL_TX PA9
114114

115115
#ifdef ARDUINO_BLACKPILL_F411CE
116+
#ifndef HSE_VALUE
116117
#define HSE_VALUE 25000000U
117118
#endif
119+
#endif
118120

119121
#ifdef __cplusplus
120122
} // extern "C"

0 commit comments

Comments
 (0)