mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 03:24:00 +00:00
rp2040: move UART0 and UART1 to common file
This is makes it easier to use these in simulation, plus it avoids duplication. The only downside I see is that more UARTs get defined than a board supports, but no existing code should break (no UARTs get renamed for example).
This commit is contained in:
committed by
Ron Evans
parent
2733e376bd
commit
c55ac9f28e
@@ -5,11 +5,6 @@
|
||||
// For more information, see: https://gopherbadge.com/
|
||||
package machine
|
||||
|
||||
import (
|
||||
"device/rp"
|
||||
"runtime/interrupt"
|
||||
)
|
||||
|
||||
const (
|
||||
/*ADC0 Pin = GPIO26
|
||||
ADC1 Pin = GPIO27
|
||||
@@ -92,17 +87,4 @@ const (
|
||||
UART_RX_PIN = UART0_RX_PIN
|
||||
)
|
||||
|
||||
// UART on the RP2040
|
||||
var (
|
||||
UART1 = &_UART1
|
||||
_UART1 = UART{
|
||||
Buffer: NewRingBuffer(),
|
||||
Bus: rp.UART1,
|
||||
}
|
||||
)
|
||||
|
||||
var DefaultUART = UART1
|
||||
|
||||
func init() {
|
||||
UART1.Interrupt = interrupt.New(rp.IRQ_UART1_IRQ, _UART1.handleInterrupt)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user