Skip to content

Commit 6e6b149

Browse files
committed
Switched to UPPER_CASE for unions
PascalCase doesn't work when we have registers named `FOO_11` and `FOO1_1`. This happened in * Freescale MKL81Z7 * Freescale MKL82Z7 * Freescale MK81F25615 * Freescale MK82F25615 on `LTC0_PK*` registers.
1 parent 755c951 commit 6e6b149

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/generate/peripheral.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use svd::{Cluster, ClusterInfo, Defaults, Peripheral, Register};
77
use syn::{self, Ident};
88

99
use errors::*;
10-
use util::{self, ToSanitizedPascalCase, ToSanitizedSnakeCase, ToSanitizedUpperCase, BITS_PER_BYTE};
10+
use util::{self, ToSanitizedSnakeCase, ToSanitizedUpperCase, BITS_PER_BYTE};
1111

1212
use generate::register;
1313

@@ -490,7 +490,7 @@ fn register_or_cluster_block_nightly(
490490
if region.fields.len() > 1 && !block_is_union {
491491
let (type_name, name) = match region.ident.clone() {
492492
Some(prefix) => {
493-
(Ident::new(format!("{}Union", prefix.to_sanitized_pascal_case())),
493+
(Ident::new(format!("{}_UNION", prefix.to_sanitized_upper_case())),
494494
Ident::new(prefix))
495495
}
496496
// If we can't find a name, fall back to the region index as a

0 commit comments

Comments
 (0)