Skip to content

Commit 1f794ae

Browse files
bors[bot]burrbull
andauthored
Merge #674
674: Make `generic.rs` generic again r=therealprof a=burrbull Co-authored-by: Andrey Zgarbul <[email protected]>
2 parents 1131083 + 7f55145 commit 1f794ae

File tree

4 files changed

+218
-181
lines changed

4 files changed

+218
-181
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
- Make `generic.rs` generic
1011
- Change initial write value for registers with modifiedWriteValues
1112
- Update `clap` to 4.0, use `irx-config` instead of `clap_conf`
1213
- Add #[must_use] to prevent hanging field writers

src/generate/device.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::borrow::Cow;
77
use std::fs::File;
88
use std::io::Write;
99

10-
use crate::util::{self, Config, ToSanitizedCase, U32Ext};
10+
use crate::util::{self, Config, ToSanitizedCase};
1111
use crate::Target;
1212
use anyhow::{Context, Result};
1313

@@ -146,15 +146,10 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
146146
});
147147
}
148148

149-
let reg_sizes = util::get_register_sizes(d);
150-
151149
let generic_file = std::str::from_utf8(include_bytes!("generic.rs"))?;
152150
if config.generic_mod {
153151
let mut file = File::create(config.output_dir.join("generic.rs"))?;
154152
writeln!(file, "{}", generic_file)?;
155-
for ty in reg_sizes {
156-
writeln!(file, "impl_proxy!({});", ty.size_to_str()?)?;
157-
}
158153
if config.target == Target::Msp430 && config.nightly {
159154
let msp430_atomic_file =
160155
std::str::from_utf8(include_bytes!("generic_msp430_atomic.rs"))?;
@@ -175,10 +170,6 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
175170
}
176171
} else {
177172
let mut tokens = syn::parse_file(generic_file)?.into_token_stream();
178-
for ty in reg_sizes {
179-
let ty = Ident::new(ty.size_to_str()?, Span::call_site());
180-
tokens.extend(quote! { impl_proxy!(#ty); });
181-
}
182173
if config.target == Target::Msp430 && config.nightly {
183174
let msp430_atomic_file =
184175
std::str::from_utf8(include_bytes!("generic_msp430_atomic.rs"))?;

0 commit comments

Comments
 (0)