uart: fix issue where a index is checked before set
Related to #152 Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
@@ -142,8 +142,8 @@ mraa_uart_init(int index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pos >= 0) {
|
|
||||||
pos = plat->uart_dev[index].tx;
|
pos = plat->uart_dev[index].tx;
|
||||||
|
if (pos >= 0) {
|
||||||
if (plat->pins[pos].uart.mux_total > 0) {
|
if (plat->pins[pos].uart.mux_total > 0) {
|
||||||
if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) {
|
if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) {
|
||||||
syslog(LOG_ERR, "uart: failed to setup muxes for TX pin");
|
syslog(LOG_ERR, "uart: failed to setup muxes for TX pin");
|
||||||
|
|||||||
Reference in New Issue
Block a user