mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 10:43:29 +00:00
machine: make UART objects pointer receivers
This means that machine.UART0, machine.UART1, etc are of type *machine.UART, not machine.UART. This makes them easier to pass around and avoids surprises when they are passed around by value while they should be passed around by reference. There is a small code size impact in some cases, but it is relatively minor.
This commit is contained in:
committed by
Ron Evans
parent
7c949ad386
commit
aa5b8d0df7
@@ -80,11 +80,11 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
TeensyUART1 = &UART0
|
||||
TeensyUART2 = &UART1
|
||||
TeensyUART3 = &UART2
|
||||
TeensyUART4 = &UART3
|
||||
TeensyUART5 = &UART4
|
||||
TeensyUART1 = UART0
|
||||
TeensyUART2 = UART1
|
||||
TeensyUART3 = UART2
|
||||
TeensyUART4 = UART3
|
||||
TeensyUART5 = UART4
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user