diff options
author | Yannis Huber <[email protected]> | 2020-06-08 16:59:13 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-08 16:59:13 +0200 |
commit | e2c55e3d2657be8af55b1c80a96b8a1331c0eae3 (patch) | |
tree | 87465762b3ca2aac529b254be94ef01165e14f48 /tools/gen-device-svd | |
parent | d3f5b51cd8cfe91fae69e198bd3e5a0c45638608 (diff) | |
download | tinygo-e2c55e3d2657be8af55b1c80a96b8a1331c0eae3.tar.gz tinygo-e2c55e3d2657be8af55b1c80a96b8a1331c0eae3.zip |
gen-device-svd: fix lowercase cluster name
Diffstat (limited to 'tools/gen-device-svd')
-rwxr-xr-x | tools/gen-device-svd/gen-device-svd.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/gen-device-svd/gen-device-svd.go b/tools/gen-device-svd/gen-device-svd.go index c32cf9734..e63b026a0 100755 --- a/tools/gen-device-svd/gen-device-svd.go +++ b/tools/gen-device-svd/gen-device-svd.go @@ -342,6 +342,11 @@ func readSVD(path, sourceURL string) (*Device, error) { firstAddress := clusterRegisters[0].address dimIncrement = int(lastAddress - firstAddress) } + + if !unicode.IsUpper(rune(clusterName[0])) && !unicode.IsDigit(rune(clusterName[0])) { + clusterName = strings.ToUpper(clusterName) + } + p.registers = append(p.registers, &PeripheralField{ name: clusterName, address: baseAddress + clusterOffset, |