Skip to content

Commit f864c3e

Browse files
authored
Merge pull request #853 from rust-embedded/isDefault
fix enumeratedValues with isDefault only
2 parents 5b6615e + f703c0f commit f864c3e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
99

10+
- Fix `enumeratedValues` with `isDefault` only
11+
1012
## [v0.33.4] - 2024-06-16
1113

1214
- Add `html-url` option to access `svdtools html` files from docs

src/generate/register.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ pub fn fields(
805805
// if there's no variant defined in enumeratedValues, generate enumeratedValues with new-type
806806
// wrapper struct, and generate From conversation only.
807807
// else, generate enumeratedValues into a Rust enum with functions for each variant.
808-
if variants.is_empty() {
808+
if variants.is_empty() && def.is_none() {
809809
// generate struct VALUE_READ_TY_A(fty) and From<fty> for VALUE_READ_TY_A.
810810
add_with_no_variants(
811811
mod_items,

0 commit comments

Comments
 (0)