Skip to content

Commit

Permalink
Merge pull request #758 from rust-embedded/ap
Browse files Browse the repository at this point in the history
rename const-generic to array_proxy
  • Loading branch information
Emilgardis authored Nov 19, 2023
2 parents 3ff94c7 + 6ced433 commit 1ca55ee
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 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 --const_generic --pascal_enum_values --max_cluster_size --atomics --atomics_feature atomics" }
- { rust: stable, vendor: STM32-patched, options: "--strict --array_proxy --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
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]

- rename `const-generic` feature to `array_proxy`

## [v0.30.3] - 2023-11-19

- Remove unstable lints
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="--const_generic --strict --atomics"
options="--array_proxy --strict --atomics"
;;
*)
options=$OPTIONS
Expand Down
4 changes: 2 additions & 2 deletions src/generate/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
}
writeln!(file, "\n{generic_atomic_file}")?;
}
if config.const_generic {
if config.array_proxy {
writeln!(file, "{array_proxy}")?;
}

Expand All @@ -177,7 +177,7 @@ 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.const_generic {
if config.array_proxy {
syn::parse_file(array_proxy)?.to_tokens(&mut tokens);
}

Expand Down
4 changes: 2 additions & 2 deletions src/generate/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result<Vec<RegisterBloc
size: cluster_size * array_info.dim,
accessors,
});
} else if sequential_indexes_from0 && config.const_generic {
} else if sequential_indexes_from0 && config.array_proxy {
// Include a ZST ArrayProxy giving indexed access to the
// elements.
let ap_path = array_proxy_type(ty, array_info);
Expand Down Expand Up @@ -1221,7 +1221,7 @@ fn expand_register(
let array_proxy_convertible = ac && disjoint_sequential_addresses;
let ty = name_to_ty(&ty_name);

if array_convertible || (array_proxy_convertible && config.const_generic) {
if array_convertible || (array_proxy_convertible && config.array_proxy) {
let span = Span::call_site();
let nb_name_sc = if let Some(dim_name) = array_info.dim_name.as_ref() {
util::fullname(dim_name, &info.alternate_group, config.ignore_groups)
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ fn run() -> Result<()> {
.value_name("FEATURE"),
)
.arg(
Arg::new("const_generic")
.long("const_generic")
Arg::new("array_proxy")
.long("array_proxy")
.action(ArgAction::SetTrue)
.help(
"Use const generics to generate writers for same fields with different offsets",
"Use ArrayProxy helper for non-sequential register arrays",
),
)
.arg(
Expand Down
4 changes: 2 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct Config {
#[cfg_attr(feature = "serde", serde(default))]
pub make_mod: bool,
#[cfg_attr(feature = "serde", serde(default))]
pub const_generic: bool,
pub array_proxy: bool,
#[cfg_attr(feature = "serde", serde(default))]
pub ignore_groups: bool,
#[cfg_attr(feature = "serde", serde(default))]
Expand Down Expand Up @@ -114,7 +114,7 @@ impl Default for Config {
atomics_feature: None,
generic_mod: false,
make_mod: false,
const_generic: false,
array_proxy: false,
ignore_groups: false,
keep_list: false,
strict: false,
Expand Down

0 comments on commit 1ca55ee

Please sign in to comment.