mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-21 21:09:02 +00:00
all: rename __reg to __volatile
It is less magical now: it only marks loads and stores as volatile. So the name '__reg' is a bit wrong now.
This commit is contained in:
+3
-3
@@ -143,10 +143,10 @@ package {pkgName}
|
||||
import "unsafe"
|
||||
|
||||
// Magic type name for the compiler.
|
||||
type __reg uint8
|
||||
type __volatile uint8
|
||||
|
||||
// Export this magic type name.
|
||||
type RegValue = __reg
|
||||
type RegValue = __volatile
|
||||
|
||||
// Some information about this device.
|
||||
const (
|
||||
@@ -169,7 +169,7 @@ const (
|
||||
out.write('\n\t// {description}\n'.format(**peripheral))
|
||||
for register in peripheral['registers']:
|
||||
for variant in register['variants']:
|
||||
out.write('\t{name} = (*__reg)(unsafe.Pointer(uintptr(0x{address:x})))\n'.format(**variant))
|
||||
out.write('\t{name} = (*__volatile)(unsafe.Pointer(uintptr(0x{address:x})))\n'.format(**variant))
|
||||
out.write(')\n')
|
||||
|
||||
for peripheral in device.peripherals:
|
||||
|
||||
Reference in New Issue
Block a user