Skip to content

Commit

Permalink
Merge pull request #692 from rust-embedded/parens
Browse files Browse the repository at this point in the history
accessors everywhere (breaking)
  • Loading branch information
burrbull authored Nov 23, 2023
2 parents a5bd928 + cfc5ab0 commit d79beda
Show file tree
Hide file tree
Showing 12 changed files with 450 additions and 271 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- { rust: stable, vendor: Spansion, options: "--atomics" }
- { rust: stable, vendor: STMicro, options: "" }
- { rust: stable, vendor: STMicro, options: "--atomics" }
- { rust: stable, vendor: STM32-patched, options: "--strict --array_proxy --pascal_enum_values --max_cluster_size --atomics --atomics_feature atomics" }
- { rust: stable, vendor: STM32-patched, options: "--strict --pascal_enum_values --max_cluster_size --atomics --atomics_feature atomics" }
- { rust: stable, vendor: Toshiba, options: all }
- { rust: stable, vendor: Toshiba, options: "" }
# Test MSRV
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- Use methods to access any register or cluster
- Remove all deny lints from generated crate
- Add `reexport_core_peripherals` and `reexport_interrupt` features disabled by default
- rename `const-generic` feature to `array_proxy`
- ~~rename `const-generic` feature to `array_proxy`~~ remove `ArrayProxy`
- `FieldWriter` takes offset as struct field instead of const generic.
Improves SVD field array access
Add `width`, `offset` methods
Expand Down
2 changes: 1 addition & 1 deletion ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ main() {

case $OPTIONS in
all)
options="--array_proxy --strict --atomics"
options="--strict --atomics"
;;
*)
options=$OPTIONS
Expand Down
46 changes: 0 additions & 46 deletions src/generate/array_proxy.rs

This file was deleted.

7 changes: 0 additions & 7 deletions src/generate/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke

let generic_file = include_str!("generic.rs");
let generic_atomic_file = include_str!("generic_atomic.rs");
let array_proxy = include_str!("array_proxy.rs");
if config.generic_mod {
let mut file = File::create(config.output_dir.join("generic.rs"))?;
writeln!(file, "{generic_file}")?;
Expand All @@ -148,9 +147,6 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
}
writeln!(file, "\n{generic_atomic_file}")?;
}
if config.array_proxy {
writeln!(file, "{array_proxy}")?;
}

if !config.make_mod {
out.extend(quote! {
Expand All @@ -168,9 +164,6 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
}
syn::parse_file(generic_atomic_file)?.to_tokens(&mut tokens);
}
if config.array_proxy {
syn::parse_file(array_proxy)?.to_tokens(&mut tokens);
}

out.extend(quote! {
#[allow(unused_imports)]
Expand Down
4 changes: 2 additions & 2 deletions src/generate/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn render(
.unwrap_or_else(|| interrupt.0.name.clone())
);

let value = util::unsuffixed(interrupt.0.value.into());
let value = util::unsuffixed(interrupt.0.value);

let mut feature_attribute_flag = false;
let mut feature_attribute = TokenStream::new();
Expand Down Expand Up @@ -111,7 +111,7 @@ pub fn render(
names_cfg_attr.push(feature_attribute);
}

let n = util::unsuffixed(pos.into());
let n = util::unsuffixed(pos);
match target {
Target::CortexM => {
for name in &names {
Expand Down
Loading

0 comments on commit d79beda

Please sign in to comment.