Browse Source

relax restriction on configuration with duplicate settings

pull/2111/head
ardnew 3 years ago
committed by Ron Evans
parent
commit
ca4f251050
  1. 10
      src/machine/machine_mimxrt1062_uart.go

10
src/machine/machine_mimxrt1062_uart.go

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

Loading…
Cancel
Save