avr: add support for the digispark

Blinking the on-board LED works. Nothing else has been tested yet.
This commit is contained in:
Ayke van Laethem
2018-11-20 18:34:14 +01:00
parent a96e2879b2
commit 9392ef900d
14 changed files with 421 additions and 291 deletions
+16
View File
@@ -0,0 +1,16 @@
// +build avr,attiny
package runtime
import (
"device/avr"
)
func sleepWDT(period uint8) {
// TODO: use the watchdog timer instead of a busy loop.
for i := 0x45; i != 0; i-- {
for i := 0xff; i != 0; i-- {
avr.Asm("nop")
}
}
}