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:
Ayke van Laethem
2018-09-12 22:05:41 +02:00
parent 914cd56ca5
commit 2788ab0172
4 changed files with 14 additions and 14 deletions
+3 -3
View File
@@ -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: