Skip to content

Commit 66b5ab3

Browse files
committed
[Generic] Define a default USER_BTN
Allow to build some sketches during CI build. It can be redefined if needed. Signed-off-by: Frederic Pillon <[email protected]>
1 parent e27a24d commit 66b5ab3

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

variants/Generic_F103Rx/variant.h

+5
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ extern "C" {
9393
#endif
9494
#define LED_GREEN LED_BUILTIN
9595

96+
// On-board user button
97+
#ifndef USER_BTN
98+
#define USER_BTN PC13
99+
#endif
100+
96101
// Override default Arduino configuration
97102
// SPI Definitions
98103
#define PIN_SPI_SS PA4

variants/Generic_F103Zx/variant.h

+5
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ extern "C" {
153153
#define LED_BUILTIN PC13
154154
#endif
155155

156+
// On-board user button
157+
#ifndef USER_BTN
158+
#define USER_BTN PB1
159+
#endif
160+
156161
// SPI Definitions
157162
#ifdef ARDUINO_VCCGND_F103ZET6
158163
#define PIN_SPI_SS PA15

variants/Generic_F411Cx/variant.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,15 @@ extern "C" {
7474
// On-board LED pin number
7575
#ifdef ARDUINO_BLACKPILL_F411CE
7676
#define LED_BUILTIN PC13
77-
#endif
78-
#ifndef LED_BUILTIN
77+
#elif !defined(LED_BUILTIN)
7978
#define LED_BUILTIN PA5
8079
#endif
8180
#define LED_GREEN LED_BUILTIN
8281

8382
// On-board user button
8483
#ifdef ARDUINO_BLACKPILL_F411CE
8584
#define USER_BTN PA0
86-
#endif
87-
#if !defined(USER_BTN)
85+
#elif !defined(USER_BTN)
8886
#define USER_BTN PC13
8987
#endif
9088

0 commit comments

Comments
 (0)