We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd1785e commit bdef52aCopy full SHA for bdef52a
src/machine/machine_nrf.go
@@ -79,8 +79,14 @@ func (uart UART) Configure(config UARTConfig) {
79
80
uart.SetBaudRate(config.BaudRate)
81
82
- // Set TX and RX pins from board.
83
- uart.setPins(UART_TX_PIN, UART_RX_PIN)
+ // Set TX and RX pins
+ if config.TX == 0 && config.RX == 0 {
84
+ // Use default pins
85
+ uart.setPins(UART_TX_PIN, UART_RX_PIN)
86
+ } else {
87
+ uart.setPins(config.TX, config.RX)
88
+ }
89
+
90
91
nrf.UART0.ENABLE.Set(nrf.UART_ENABLE_ENABLE_Enabled)
92
nrf.UART0.TASKS_STARTTX.Set(1)
0 commit comments