1010 *
1111 *******************************************************************************
1212 */
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
2314
2415/*----------------------------------------------------------------------------
2516 * STM32 pins number
@@ -46,66 +37,66 @@ extern "C" {
4637
4738// On-board LED pin number
4839#ifndef LED_BUILTIN
49- #define LED_BUILTIN ND
40+ #define LED_BUILTIN ND
5041#endif
5142
5243// On-board user button
5344#ifndef USER_BTN
54- #define USER_BTN ND
45+ #define USER_BTN ND
5546#endif
5647
5748// SPI definitions
5849#ifndef PIN_SPI_SS
59- #define PIN_SPI_SS {{spi_pins.ss}}
50+ #define PIN_SPI_SS {{spi_pins.ss}}
6051#endif
6152#ifndef PIN_SPI_SS1
62- #define PIN_SPI_SS1 {{spi_pins.ss1}}
53+ #define PIN_SPI_SS1 {{spi_pins.ss1}}
6354#endif
6455#ifndef PIN_SPI_SS2
65- #define PIN_SPI_SS2 {{spi_pins.ss2}}
56+ #define PIN_SPI_SS2 {{spi_pins.ss2}}
6657#endif
6758#ifndef PIN_SPI_SS3
68- #define PIN_SPI_SS3 {{spi_pins.ss3}}
59+ #define PIN_SPI_SS3 {{spi_pins.ss3}}
6960#endif
7061#ifndef PIN_SPI_MOSI
71- #define PIN_SPI_MOSI {{spi_pins.mosi}}
62+ #define PIN_SPI_MOSI {{spi_pins.mosi}}
7263#endif
7364#ifndef PIN_SPI_MISO
74- #define PIN_SPI_MISO {{spi_pins.miso}}
65+ #define PIN_SPI_MISO {{spi_pins.miso}}
7566#endif
7667#ifndef PIN_SPI_SCK
77- #define PIN_SPI_SCK {{spi_pins.sck}}
68+ #define PIN_SPI_SCK {{spi_pins.sck}}
7869#endif
7970
8071// I2C definitions
8172#ifndef PIN_WIRE_SDA
82- #define PIN_WIRE_SDA {{i2c_pins.sda}}
73+ #define PIN_WIRE_SDA {{i2c_pins.sda}}
8374#endif
8475#ifndef PIN_WIRE_SCL
85- #define PIN_WIRE_SCL {{i2c_pins.scl}}
76+ #define PIN_WIRE_SCL {{i2c_pins.scl}}
8677#endif
8778
8879// Timer Definitions
8980// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
9081#ifndef TIMER_TONE
91- #define TIMER_TONE {{timer.tone}}
82+ #define TIMER_TONE {{timer.tone}}
9283#endif
9384#ifndef TIMER_SERVO
94- #define TIMER_SERVO {{timer.servo}}
85+ #define TIMER_SERVO {{timer.servo}}
9586#endif
9687
9788// UART Definitions
9889#ifndef SERIAL_UART_INSTANCE
99- #define SERIAL_UART_INSTANCE {{serial.instance}}
90+ #define SERIAL_UART_INSTANCE {{serial.instance}}
10091#endif
10192
10293// Default pin used for generic 'Serial' instance
10394// Mandatory for Firmata
10495#ifndef PIN_SERIAL_RX
105- #define PIN_SERIAL_RX {{serial.rx}}
96+ #define PIN_SERIAL_RX {{serial.rx}}
10697#endif
10798#ifndef PIN_SERIAL_TX
108- #define PIN_SERIAL_TX {{serial.tx}}
99+ #define PIN_SERIAL_TX {{serial.tx}}
109100#endif
110101
111102{% if hal_modules_list %}
@@ -115,9 +106,6 @@ extern "C" {
115106{% endfor %}
116107
117108{% endif %}
118- #ifdef __cplusplus
119- } // extern "C"
120- #endif
121109
122110/*----------------------------------------------------------------------------
123111 * Arduino objects - C++ only
@@ -147,6 +135,3 @@ extern "C" {
147135 #endif
148136#endif
149137
150- #endif /* _VARIANT_ARDUINO_STM32_ */
151- #endif /* !ARDUINO_GENERIC_* */
152-
0 commit comments