Skip to content

Commit

Permalink
Merge pull request #853 from rust-embedded/isDefault
Browse files Browse the repository at this point in the history
fix enumeratedValues with isDefault only
  • Loading branch information
Emilgardis authored Jun 18, 2024
2 parents 5b6615e + f703c0f commit f864c3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- Fix `enumeratedValues` with `isDefault` only

## [v0.33.4] - 2024-06-16

- Add `html-url` option to access `svdtools html` files from docs
Expand Down
2 changes: 1 addition & 1 deletion src/generate/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ pub fn fields(
// if there's no variant defined in enumeratedValues, generate enumeratedValues with new-type
// wrapper struct, and generate From conversation only.
// else, generate enumeratedValues into a Rust enum with functions for each variant.
if variants.is_empty() {
if variants.is_empty() && def.is_none() {
// generate struct VALUE_READ_TY_A(fty) and From<fty> for VALUE_READ_TY_A.
add_with_no_variants(
mod_items,
Expand Down

0 comments on commit f864c3e

Please sign in to comment.