aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gen-device-svd
diff options
context:
space:
mode:
authorYannis Huber <[email protected]>2020-06-08 16:59:13 +0200
committerGitHub <[email protected]>2020-06-08 16:59:13 +0200
commite2c55e3d2657be8af55b1c80a96b8a1331c0eae3 (patch)
tree87465762b3ca2aac529b254be94ef01165e14f48 /tools/gen-device-svd
parentd3f5b51cd8cfe91fae69e198bd3e5a0c45638608 (diff)
downloadtinygo-e2c55e3d2657be8af55b1c80a96b8a1331c0eae3.tar.gz
tinygo-e2c55e3d2657be8af55b1c80a96b8a1331c0eae3.zip
gen-device-svd: fix lowercase cluster name
Diffstat (limited to 'tools/gen-device-svd')
-rwxr-xr-xtools/gen-device-svd/gen-device-svd.go5
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,