|
@ -171,7 +171,7 @@ var ( |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
// Configure the UART.
|
|
|
// Configure the UART.
|
|
|
func (uart *UART) Configure(config UARTConfig) { |
|
|
func (uart *UART) Configure(config UARTConfig) error { |
|
|
// Default baud rate to 115200.
|
|
|
// Default baud rate to 115200.
|
|
|
if config.BaudRate == 0 { |
|
|
if config.BaudRate == 0 { |
|
|
config.BaudRate = 115200 |
|
|
config.BaudRate = 115200 |
|
@ -196,6 +196,8 @@ func (uart *UART) Configure(config UARTConfig) { |
|
|
intr := interrupt.New(nrf.IRQ_UART0, _UART0.handleInterrupt) |
|
|
intr := interrupt.New(nrf.IRQ_UART0, _UART0.handleInterrupt) |
|
|
intr.SetPriority(0xc0) // low priority
|
|
|
intr.SetPriority(0xc0) // low priority
|
|
|
intr.Enable() |
|
|
intr.Enable() |
|
|
|
|
|
|
|
|
|
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// SetBaudRate sets the communication speed for the UART.
|
|
|
// SetBaudRate sets the communication speed for the UART.
|
|
|