mirror of https://github.com/ARMmbed/mbed-os.git
[Nuvoton] Check configuration option for default UART baudrate setting
parent
ae98b94a10
commit
a937a62bff
|
@ -221,8 +221,19 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
|
|||
pinmap_pinout(tx, PinMap_UART_TX);
|
||||
pinmap_pinout(rx, PinMap_UART_RX);
|
||||
|
||||
// Configure the UART module and set its baudrate
|
||||
serial_baud(obj, 9600);
|
||||
// Configure baudrate
|
||||
int baudrate = 9600;
|
||||
if (obj->serial.uart == STDIO_UART) {
|
||||
#if MBED_CONF_PLATFORM_STDIO_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_STDIO_BAUD_RATE;
|
||||
#endif
|
||||
} else {
|
||||
#if MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE;
|
||||
#endif
|
||||
}
|
||||
serial_baud(obj, baudrate);
|
||||
|
||||
// Configure data bits, parity, and stop bits
|
||||
serial_format(obj, 8, ParityNone, 1);
|
||||
}
|
||||
|
|
|
@ -181,8 +181,19 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
|
|||
pinmap_pinout(tx, PinMap_UART_TX);
|
||||
pinmap_pinout(rx, PinMap_UART_RX);
|
||||
|
||||
// Configure the UART module and set its baudrate
|
||||
serial_baud(obj, 9600);
|
||||
// Configure baudrate
|
||||
int baudrate = 9600;
|
||||
if (obj->serial.uart == STDIO_UART) {
|
||||
#if MBED_CONF_PLATFORM_STDIO_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_STDIO_BAUD_RATE;
|
||||
#endif
|
||||
} else {
|
||||
#if MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE;
|
||||
#endif
|
||||
}
|
||||
serial_baud(obj, baudrate);
|
||||
|
||||
// Configure data bits, parity, and stop bits
|
||||
serial_format(obj, 8, ParityNone, 1);
|
||||
}
|
||||
|
|
|
@ -211,8 +211,19 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
|
|||
pinmap_pinout(tx, PinMap_UART_TX);
|
||||
pinmap_pinout(rx, PinMap_UART_RX);
|
||||
|
||||
// Configure the UART module and set its baudrate
|
||||
serial_baud(obj, 9600);
|
||||
// Configure baudrate
|
||||
int baudrate = 9600;
|
||||
if (obj->serial.uart == STDIO_UART) {
|
||||
#if MBED_CONF_PLATFORM_STDIO_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_STDIO_BAUD_RATE;
|
||||
#endif
|
||||
} else {
|
||||
#if MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE;
|
||||
#endif
|
||||
}
|
||||
serial_baud(obj, baudrate);
|
||||
|
||||
// Configure data bits, parity, and stop bits
|
||||
serial_format(obj, 8, ParityNone, 1);
|
||||
}
|
||||
|
|
|
@ -146,8 +146,19 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
|
|||
pinmap_pinout(tx, PinMap_UART_TX);
|
||||
pinmap_pinout(rx, PinMap_UART_RX);
|
||||
|
||||
// Configure the UART module and set its baudrate
|
||||
serial_baud(obj, 9600);
|
||||
// Configure baudrate
|
||||
int baudrate = 9600;
|
||||
if (obj->serial.uart == STDIO_UART) {
|
||||
#if MBED_CONF_PLATFORM_STDIO_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_STDIO_BAUD_RATE;
|
||||
#endif
|
||||
} else {
|
||||
#if MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE;
|
||||
#endif
|
||||
}
|
||||
serial_baud(obj, baudrate);
|
||||
|
||||
// Configure data bits, parity, and stop bits
|
||||
serial_format(obj, 8, ParityNone, 1);
|
||||
}
|
||||
|
|
|
@ -211,8 +211,19 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
|
|||
pinmap_pinout(tx, PinMap_UART_TX);
|
||||
pinmap_pinout(rx, PinMap_UART_RX);
|
||||
|
||||
// Configure the UART module and set its baudrate
|
||||
serial_baud(obj, 9600);
|
||||
// Configure baudrate
|
||||
int baudrate = 9600;
|
||||
if (obj->serial.uart == STDIO_UART) {
|
||||
#if MBED_CONF_PLATFORM_STDIO_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_STDIO_BAUD_RATE;
|
||||
#endif
|
||||
} else {
|
||||
#if MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE
|
||||
baudrate = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE;
|
||||
#endif
|
||||
}
|
||||
serial_baud(obj, baudrate);
|
||||
|
||||
// Configure data bits, parity, and stop bits
|
||||
serial_format(obj, 8, ParityNone, 1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue