relax restriction on configuration with duplicate settings

This commit is contained in:
ardnew
2021-09-11 05:30:26 -05:00
committed by Ron Evans
parent 1e92e5f6c6
commit ca4f251050
-10
View File
@@ -45,11 +45,6 @@ func (uart *UART) resetTransmitting() {
uart.Bus.GLOBAL.ClearBits(nxp.LPUART_GLOBAL_RST)
}
func (uart *UART) usesConfig(c UARTConfig) bool {
return uart.configured && uart.baud == c.BaudRate &&
uart.rx == c.RX && uart.tx == c.TX
}
// Configure initializes a UART with the given UARTConfig and other default
// settings.
func (uart *UART) Configure(config UARTConfig) {
@@ -67,11 +62,6 @@ func (uart *UART) Configure(config UARTConfig) {
config.TX = UART_TX_PIN
}
// Do not reconfigure pins and device buffers if duplicate config provided.
if uart.usesConfig(config) {
return
}
uart.baud = config.BaudRate
uart.rx = config.RX
uart.tx = config.TX