relax restriction on configuration with duplicate settings

Этот коммит содержится в:
ardnew 2021-09-11 05:30:26 -05:00 коммит произвёл Ron Evans
родитель 1e92e5f6c6
коммит ca4f251050

Просмотреть файл

@ -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