STM32: Add cfg to differentiate L4 and L4+ families

This commit is contained in:
Adam Greig 2023-11-19 04:26:36 +00:00 committed by Dario Nieuwenhuis
parent 2218d30c80
commit 897663e023

View File

@ -1376,6 +1376,15 @@ fn main() {
println!("cargo:rustc-cfg=flashsize_{}", &chip_name[10..11]); println!("cargo:rustc-cfg=flashsize_{}", &chip_name[10..11]);
} }
// Mark the L4+ chips as they have many differences to regular L4.
if &chip_name[..7] == "stm32l4" {
if "pqrs".contains(&chip_name[7..8]) {
println!("cargo:rustc-cfg=stm32l4_plus");
} else {
println!("cargo:rustc-cfg=stm32l4_nonplus");
}
}
println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=build.rs");
} }