stm32-metapac: add new codegen, allows pregenerating the entire pac

This commit is contained in:
Dario Nieuwenhuis
2021-06-07 05:10:11 +02:00
parent 08bd140c6d
commit 5b8ac447f2
9 changed files with 549 additions and 374 deletions

View File

@ -0,0 +1,16 @@
use std::env;
fn main() {
let _chip_name = env::vars_os()
.map(|(a, _)| a.to_string_lossy().to_string())
.find(|x| x.starts_with("CARGO_FEATURE_STM32"))
.expect("No stm32xx Cargo feature enabled")
.strip_prefix("CARGO_FEATURE_")
.unwrap()
.to_ascii_lowercase();
#[cfg(feature = "rt")]
println!("cargo:rustc-link-search=src/chips/{}", _chip_name);
println!("cargo:rerun-if-changed=build.rs");
}

View File

@ -0,0 +1,6 @@
// GEN PATHS HERE
mod inner;
pub mod common;
pub use inner::*;