Skip to content

No unions #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dd663bd
First pass at implementing derivedFrom.
nsabovic Mar 11, 2018
5e193ae
fixup semicolons
wez Mar 15, 2018
cb134d2
expand derived registers
wez Mar 15, 2018
32d8b5e
point to svd master
wez Aug 23, 2018
128a308
Merge branch 'master' into register-derived-from
Nov 17, 2018
b6d2c9a
Compiles with newest `svd` master
Nov 17, 2018
94443c3
pull in fix for #65
wez Jan 3, 2019
17ed61d
remove dep on untagged unions
wez Jan 3, 2019
454ac72
add missing doc comments, use usize for the offsets
wez Jan 3, 2019
5c9f27f
simplify union removal, and remove all traces of unions
wez Jan 4, 2019
a997b85
fixup padding of fields emitted after a union!
wez Jan 4, 2019
ef24936
inline the union accessors
wez Jan 4, 2019
70c885b
Merge branch 'master' of https://github.com/rust-embedded/svd2rust in…
burrbull Jun 1, 2019
b7965db
rm ref
burrbull Jun 1, 2019
e76f2c2
Merge pull request #301 from burrbull/register-derived-from
Emilgardis Jun 1, 2019
718c76b
resolve conflicts
burrbull Jul 12, 2019
645a253
Merge branch 'no_unions' of https://github.com/wez/svd2rust into no_u…
burrbull Jul 13, 2019
442b482
Merge branch 'master' of https://github.com/rust-embedded/svd2rust in…
burrbull Jul 13, 2019
cd48f43
rm either
burrbull Jul 13, 2019
fbc831f
Register derived from (resolve) (#312)
burrbull Jul 15, 2019
f105144
conflicts
burrbull Jul 15, 2019
4f70a2f
Merge branch 'register-derived-from' of https://github.com/burrbull/s…
burrbull Jul 15, 2019
ebe8572
Merge branch 'register-derived-from' of https://github.com/burrbull/s…
burrbull Jul 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ path = "src/main.rs"
[dependencies]
cast = "0.2.2"
clap = "2.26.0"
either = "1.0.3"
env_logger = "~0.5"
error-chain = "0.11.0"
inflections = "1.1.0"
log = { version = "~0.4", features = ["std"] }
quote = "0.3.15"
svd-parser = "0.6"
svd-parser = "0.7.0"
syn = "0.11.11"
11 changes: 2 additions & 9 deletions src/generate/device.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use quote::Tokens;
use crate::svd::Device;
use quote::Tokens;
use syn::Ident;

use crate::errors::*;
Expand Down Expand Up @@ -48,12 +48,6 @@ pub fn render(
#![no_std]
});

if nightly {
out.push(quote! {
#![feature(untagged_unions)]
});
}

match target {
Target::CortexM => {
out.push(quote! {
Expand Down Expand Up @@ -107,8 +101,7 @@ pub fn render(

let core_peripherals: &[_] = if fpu_present {
&[
"CBP", "CPUID", "DCB", "DWT", "FPB", "FPU", "ITM", "MPU", "NVIC", "SCB", "SYST",
"TPIU",
"CBP", "CPUID", "DCB", "DWT", "FPB", "FPU", "ITM", "MPU", "NVIC", "SCB", "SYST", "TPIU",
]
} else {
&[
Expand Down
2 changes: 1 addition & 1 deletion src/generate/interrupt.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::collections::HashMap;
use std::fmt::Write;

use crate::svd::Peripheral;
use cast::u64;
use quote::Tokens;
use crate::svd::Peripheral;
use syn::Ident;

use crate::errors::*;
Expand Down
Loading