mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 21:13:39 +00:00
all: move Register{8,16,32} values into runtime/volatile
This avoids duplication of code. None of the smoke tests have changed their output.
This commit is contained in:
committed by
Ron Evans
parent
66aca428ba
commit
9673ad3774
@@ -4,6 +4,7 @@ package machine
|
||||
|
||||
import (
|
||||
"device/avr"
|
||||
"runtime/volatile"
|
||||
)
|
||||
|
||||
// Configure sets the pin to input or output.
|
||||
@@ -34,7 +35,7 @@ func (p Pin) Get() bool {
|
||||
}
|
||||
}
|
||||
|
||||
func (p Pin) getPortMask() (*avr.Register8, uint8) {
|
||||
func (p Pin) getPortMask() (*volatile.Register8, uint8) {
|
||||
if p < 8 {
|
||||
return avr.PORTD, 1 << uint8(p)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user