Skip to content

Commit 785862e

Browse files
committed
STM32F2: STDIO_UART_TX and STDIO_UART_RX can be now user defined
1 parent f97d846 commit 785862e

File tree

1 file changed

+16
-8
lines changed
  • targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG

1 file changed

+16
-8
lines changed

targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/PinNames.h

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,18 @@ typedef enum {
227227
D14 = PB_9,
228228
D15 = PB_8,
229229

230+
// STDIO for console print
231+
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
232+
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
233+
#else
234+
STDIO_UART_TX = PD_8,
235+
#endif
236+
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
237+
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
238+
#else
239+
STDIO_UART_RX = PD_9,
240+
#endif
241+
230242
// Generic signals namings
231243
LED1 = PB_0,
232244
LED2 = PB_7,
@@ -235,10 +247,10 @@ typedef enum {
235247
USER_BUTTON = PC_13,
236248
// Standardized button names
237249
BUTTON1 = USER_BUTTON,
238-
SERIAL_TX = PD_8,
239-
SERIAL_RX = PD_9,
240-
USBTX = SERIAL_TX,
241-
USBRX = SERIAL_RX,
250+
SERIAL_TX = STDIO_UART_TX,
251+
SERIAL_RX = STDIO_UART_RX,
252+
USBTX = STDIO_UART_TX,
253+
USBRX = STDIO_UART_RX,
242254
I2C_SCL = D15,
243255
I2C_SDA = D14,
244256
SPI_MOSI = PB_5, // Conflict between D11 and RMII RX Data Valid (PA7)
@@ -275,10 +287,6 @@ typedef enum {
275287
NC = (int)0xFFFFFFFF
276288
} PinName;
277289

278-
#define STDIO_UART_TX SERIAL_TX
279-
#define STDIO_UART_RX SERIAL_RX
280-
#define STDIO_UART UART_3
281-
282290
#ifdef __cplusplus
283291
}
284292
#endif

0 commit comments

Comments
 (0)