Skip to content

Commit 09311ba

Browse files
committed
[Generic F4xx] Allow some re-definitions
USER_BTN and LED_BUILTIN can be redefined Signed-off-by: Frederic Pillon <[email protected]>
1 parent 33278e9 commit 09311ba

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

variants/Generic_F401Cx/variant.h

+2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ extern "C" {
7777
#define LED_GREEN LED_BUILTIN
7878

7979
// On-board user button
80+
#ifndef USER_BTN
8081
#define USER_BTN PC13
82+
#endif
8183

8284
// SPI definitions
8385
#define PIN_SPI_SS PA4

variants/Generic_F401Rx/variant.h

+4
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,15 @@ extern "C" {
8787
#define NUM_ANALOG_INPUTS 16
8888

8989
// On-board LED pin number
90+
#ifndef LED_BUILTIN
9091
#define LED_BUILTIN PA5
92+
#endif
9193
#define LED_GREEN LED_BUILTIN
9294

9395
// On-board user button
96+
#ifndef USER_BTN
9497
#define USER_BTN PC13
98+
#endif
9599

96100
// SPI definitions
97101
#define PIN_SPI_SS PA4

variants/Generic_F410Rx/variant.h

+2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ extern "C" {
9595
#define LED_GREEN LED_BUILTIN
9696

9797
// On-board user button
98+
#ifndef USER_BTN
9899
#define USER_BTN PC13
100+
#endif
99101

100102
// Timer Definitions
101103
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin

variants/Generic_F411Cx/variant.h

+2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ extern "C" {
7878
#define LED_GREEN LED_BUILTIN
7979

8080
// On-board user button
81+
#ifndef USER_BTN
8182
#define USER_BTN PC13
83+
#endif
8284

8385
// SPI definitions
8486
#define PIN_SPI_SS PA4

variants/Generic_F411Rx/variant.h

+2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ extern "C" {
9393
#define LED_GREEN LED_BUILTIN
9494

9595
// On-board user button
96+
#ifndef USER_BTN
9697
#define USER_BTN PC13
98+
#endif
9799

98100
// SPI definitions
99101
#define PIN_SPI_SS PA4

0 commit comments

Comments
 (0)