tinygo/src/machine/machine_attiny85.go
Ayke van Laethem 77ec9b6369 all: update build constraints to Go 1.17
Do it all at once in preparation for Go 1.18 support.

To make this commit, I've simply modified the `fmt-check` Makefile
target to rewrite files instead of listing the differences. So this is a
fully mechanical change, it should not have introduced any errors.
2022-02-04 07:49:46 +01:00

24 строки
376 Б
Go

//go:build attiny85
// +build attiny85
package machine
import (
"device/avr"
"runtime/volatile"
)
const (
PB0 Pin = iota
PB1
PB2
PB3
PB4
PB5
)
// getPortMask returns the PORTx register and mask for the pin.
func (p Pin) getPortMask() (*volatile.Register8, uint8) {
// Very simple for the attiny85, which only has a single port.
return avr.PORTB, 1 << uint8(p)
}