10
10
*
11
11
*******************************************************************************
12
12
*/
13
-
14
- #if !defined(ARDUINO_GENERIC_ {{generic_list [0 ].board }}){% for name in generic_list [1 :] %} & & !defined (ARDUINO_GENERIC_ {{name .board }}){% endfor %}
15
-
16
- #include VARIANT_BOARD_H
17
- #else
18
- #ifndef _VARIANT_ARDUINO_STM32_
19
- #define _VARIANT_ARDUINO_STM32_
20
- #ifdef __cplusplus
21
- extern "C" {
22
- #endif // __cplusplus
13
+ #pragma once
23
14
24
15
/*----------------------------------------------------------------------------
25
16
* STM32 pins number
@@ -46,79 +37,77 @@ extern "C" {
46
37
47
38
// On-board LED pin number
48
39
#ifndef LED_BUILTIN
49
- #define LED_BUILTIN ND
40
+ #define LED_BUILTIN ND
50
41
#endif
51
42
52
43
// On-board user button
53
44
#ifndef USER_BTN
54
- #define USER_BTN ND
45
+ #define USER_BTN ND
55
46
#endif
56
47
57
48
// SPI definitions
58
49
#ifndef PIN_SPI_SS
59
- #define PIN_SPI_SS {{spi_pins.ss}}
50
+ #define PIN_SPI_SS {{spi_pins.ss}}
60
51
#endif
61
52
#ifndef PIN_SPI_SS1
62
- #define PIN_SPI_SS1 {{spi_pins.ss1}}
53
+ #define PIN_SPI_SS1 {{spi_pins.ss1}}
63
54
#endif
64
55
#ifndef PIN_SPI_SS2
65
- #define PIN_SPI_SS2 {{spi_pins.ss2}}
56
+ #define PIN_SPI_SS2 {{spi_pins.ss2}}
66
57
#endif
67
58
#ifndef PIN_SPI_SS3
68
- #define PIN_SPI_SS3 {{spi_pins.ss3}}
59
+ #define PIN_SPI_SS3 {{spi_pins.ss3}}
69
60
#endif
70
61
#ifndef PIN_SPI_MOSI
71
- #define PIN_SPI_MOSI {{spi_pins.mosi}}
62
+ #define PIN_SPI_MOSI {{spi_pins.mosi}}
72
63
#endif
73
64
#ifndef PIN_SPI_MISO
74
- #define PIN_SPI_MISO {{spi_pins.miso}}
65
+ #define PIN_SPI_MISO {{spi_pins.miso}}
75
66
#endif
76
67
#ifndef PIN_SPI_SCK
77
- #define PIN_SPI_SCK {{spi_pins.sck}}
68
+ #define PIN_SPI_SCK {{spi_pins.sck}}
78
69
#endif
79
70
80
71
// I2C definitions
81
72
#ifndef PIN_WIRE_SDA
82
- #define PIN_WIRE_SDA {{i2c_pins.sda}}
73
+ #define PIN_WIRE_SDA {{i2c_pins.sda}}
83
74
#endif
84
75
#ifndef PIN_WIRE_SCL
85
- #define PIN_WIRE_SCL {{i2c_pins.scl}}
76
+ #define PIN_WIRE_SCL {{i2c_pins.scl}}
86
77
#endif
87
78
88
79
// Timer Definitions
89
80
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
90
81
#ifndef TIMER_TONE
91
- #define TIMER_TONE {{timer.tone}}
82
+ #define TIMER_TONE {{timer.tone}}
92
83
#endif
93
84
#ifndef TIMER_SERVO
94
- #define TIMER_SERVO {{timer.servo}}
85
+ #define TIMER_SERVO {{timer.servo}}
95
86
#endif
96
87
97
88
// UART Definitions
98
89
#ifndef SERIAL_UART_INSTANCE
99
- #define SERIAL_UART_INSTANCE {{serial.instance}}
90
+ #define SERIAL_UART_INSTANCE {{serial.instance}}
100
91
#endif
101
92
102
93
// Default pin used for generic 'Serial' instance
103
94
// Mandatory for Firmata
104
95
#ifndef PIN_SERIAL_RX
105
- #define PIN_SERIAL_RX {{serial.rx}}
96
+ #define PIN_SERIAL_RX {{serial.rx}}
106
97
#endif
107
98
#ifndef PIN_SERIAL_TX
108
- #define PIN_SERIAL_TX {{serial.tx}}
99
+ #define PIN_SERIAL_TX {{serial.tx}}
109
100
#endif
110
101
111
102
{% if hal_modules_list %}
112
103
// Extra HAL modules
113
104
{% for hal_module in hal_modules_list %}
114
- #define {{hal_module }}
105
+ #if !defined(HAL_ {{hal_module }}_MODULE_DISABLED )
106
+ #define HAL_ {{hal_module}}_MODULE_ENABLED
107
+ #endif
115
108
{% endfor %}
116
109
117
110
{% endif %}
118
- #ifdef __cplusplus
119
- } // extern "C"
120
- #endif
121
-
122
111
/*----------------------------------------------------------------------------
123
112
* Arduino objects - C++ only
124
113
*----------------------------------------------------------------------------*/
@@ -147,6 +136,3 @@ extern "C" {
147
136
#endif
148
137
#endif
149
138
150
- #endif /* _VARIANT_ARDUINO_STM32_ */
151
- #endif /* !ARDUINO_GENERIC_* */
152
-
0 commit comments