Skip to content

Commit 6bb92b1

Browse files
committed
update stdio uart for lpc4337 and set baudrate to 9600
1 parent f6adbf7 commit 6bb92b1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC43XX/PeripheralNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ typedef enum {
8888

8989
#define STDIO_UART_TX USBTX
9090
#define STDIO_UART_RX USBRX
91-
#define STDIO_UART UART_2
91+
#define STDIO_UART UART_0
9292

9393
// Default peripherals
9494
#define MBED_SPI0 SPI0_MOSI, SPI0_MISO, SPI0_SCK, SPI0_SSEL

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC43XX/serial_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
134134
| 0 << 2; // Rx Line Status irq enable
135135

136136
// set default baud rate and format
137-
is_stdio_uart = (uart == STDIO_UART) ? (1) : (0);
138-
serial_baud (obj, is_stdio_uart ? 115200 : 9600);
137+
serial_baud (obj, 9600);
139138
serial_format(obj, 8, ParityNone, 1);
140139

141140
// pinout the chosen uart
@@ -160,6 +159,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
160159
uart_data[obj->index].sw_cts.pin = NC;
161160
serial_set_flow_control(obj, FlowControlNone, NC, NC);
162161

162+
is_stdio_uart = (uart == STDIO_UART) ? (1) : (0);
163+
163164
if (is_stdio_uart) {
164165
stdio_uart_inited = 1;
165166
memcpy(&stdio_uart, obj, sizeof(serial_t));

0 commit comments

Comments
 (0)