diff options
author | Ron Evans <[email protected]> | 2018-11-28 10:27:09 +0100 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-12-01 18:17:28 +0100 |
commit | 70830cd9da2c74c5881af18b677a9d6fdfbadf71 (patch) | |
tree | 4310f0f0cdcbba03cfb8d470476352d5585255f8 /tools | |
parent | e54a1c4dc048ffbee5ed6bb5ad65c9460b7dc9d9 (diff) | |
download | tinygo-70830cd9da2c74c5881af18b677a9d6fdfbadf71.tar.gz tinygo-70830cd9da2c74c5881af18b677a9d6fdfbadf71.zip |
tools: correct error generating board files that calculated the address incorrectly after a cluster type
Signed-off-by: Ron Evans <[email protected]>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/gen-device-svd.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/gen-device-svd.py b/tools/gen-device-svd.py index f823d3400..dcfd3a2da 100755 --- a/tools/gen-device-svd.py +++ b/tools/gen-device-svd.py @@ -293,6 +293,7 @@ const ( padNumber += 1 regType = 'RegValue' + lastCluster = False if 'registers' in register: # This is a cluster, not a register. Create the cluster type. regType = 'struct {\n' @@ -320,13 +321,18 @@ const ( regType += '\t\t_padding{padNumber} RegValue\n'.format(padNumber=padNumber) else: regType += '\t\t_padding{padNumber} [{num}]RegValue\n'.format(padNumber=padNumber, num=numSkip) + else: + lastCluster = True regType += '\t}' + address = subaddress if register['array'] is not None: regType = '[{}]{}'.format(register['array'], regType) out.write('\t{name} {regType}\n'.format(name=register['name'], regType=regType)) # next address - if register['array'] is not None: + if lastCluster is True: + lastCluster = False + elif register['array'] is not None: address = register['address'] + register['elementsize'] * register['array'] else: address = register['address'] + register['elementsize'] |