aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2018-09-30 12:52:34 +0200
committerAyke van Laethem <[email protected]>2018-09-30 14:56:19 +0200
commit9b4a6dcc14e87cc22f6f490be73d853132ef614e (patch)
treea8a92de5eddcc12dfb83c70caa7c15f37168ff5f /tools
parente77a5af5d2b1bba4519151ed06b0549e50c14f74 (diff)
downloadtinygo-9b4a6dcc14e87cc22f6f490be73d853132ef614e.tar.gz
tinygo-9b4a6dcc14e87cc22f6f490be73d853132ef614e.zip
tools/gen-device-svd: move peripheral list to beginning
It's much easier to scan the source when the peripheral list is at the front. Go doesn't care about the order of declaration anyway.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/gen-device-svd.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/gen-device-svd.py b/tools/gen-device-svd.py
index 7ef3fbd27..4db8edcd4 100755
--- a/tools/gen-device-svd.py
+++ b/tools/gen-device-svd.py
@@ -228,6 +228,12 @@ const (
out.write('\tIRQ_max = {} // Highest interrupt number on this device.\n'.format(intrMax))
out.write(')\n')
+ # Define actual peripheral pointers.
+ out.write('\n// Peripherals.\nvar (\n')
+ for peripheral in device.peripherals:
+ out.write('\t{name} = (*{groupName}_Type)(unsafe.Pointer(uintptr(0x{baseAddress:x}))) // {description}\n'.format(**peripheral))
+ out.write(')\n')
+
# Define peripheral struct types.
for peripheral in device.peripherals:
if 'registers' not in peripheral:
@@ -265,12 +271,6 @@ const (
address = register['address'] + 4
out.write('}\n')
- # Define actual peripheral pointers.
- out.write('\n// Peripherals.\nvar (\n')
- for peripheral in device.peripherals:
- out.write('\t{name} = (*{groupName}_Type)(unsafe.Pointer(uintptr(0x{baseAddress:x}))) // {description}\n'.format(**peripheral))
- out.write(')\n')
-
# Define bitfields.
for peripheral in device.peripherals:
if 'registers' not in peripheral: