runtime: update to avoid //go:volatile

There was exactly one change in the output of the smoke tests:
examples/test. However, it still runs just fine on a PCA10040.
This commit is contained in:
Ayke van Laethem
2019-06-06 14:18:47 +02:00
committed by Ron Evans
parent 9673ad3774
commit c84c625585
5 changed files with 23 additions and 33 deletions
+3 -5
View File
@@ -7,6 +7,7 @@ package runtime
import (
"device/arm"
"runtime/volatile"
"unsafe"
)
@@ -36,12 +37,9 @@ func ticks() timeUnit {
return timestamp
}
//go:volatile
type regValue uint32
// UART0 output register.
var stdoutWrite *regValue = (*regValue)(unsafe.Pointer(uintptr(0x4000c000)))
var stdoutWrite = (*volatile.Register8)(unsafe.Pointer(uintptr(0x4000c000)))
func putchar(c byte) {
*stdoutWrite = regValue(c)
stdoutWrite.Set(uint8(c))
}