aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32-wpan/build.rs
diff options
context:
space:
mode:
authorTaylor Carpenter <[email protected]>2024-02-01 10:41:41 -0500
committerTaylor Carpenter <[email protected]>2024-02-01 10:41:41 -0500
commit72ca5a022b44fe621fbae52a33ac7e45b9cc66a2 (patch)
tree25918564ea5aa7f213c13ce2506cc11b92e83cc6 /embassy-stm32-wpan/build.rs
parent9cd0beaee37f9e1cc885ad162b63bca795478227 (diff)
Add scatter memory files for extended BLE stack
Build script chooses the 'x.in' to copy over to 'tl_mbox.x' based on features
Diffstat (limited to 'embassy-stm32-wpan/build.rs')
-rw-r--r--embassy-stm32-wpan/build.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/embassy-stm32-wpan/build.rs b/embassy-stm32-wpan/build.rs
index 94aac070d..7ab458bf2 100644
--- a/embassy-stm32-wpan/build.rs
+++ b/embassy-stm32-wpan/build.rs
@@ -18,9 +18,22 @@ fn main() {
18 // stm32wb tl_mbox link sections 18 // stm32wb tl_mbox link sections
19 19
20 let out_file = out_dir.join("tl_mbox.x").to_string_lossy().to_string(); 20 let out_file = out_dir.join("tl_mbox.x").to_string_lossy().to_string();
21 fs::write(out_file, fs::read_to_string("tl_mbox.x.in").unwrap()).unwrap(); 21 let in_file;
22 if env::var_os("CARGO_FEATURE_EXTENDED").is_some() {
23 if env::vars()
24 .map(|(a, _)| a)
25 .any(|x| x.starts_with("CARGO_FEATURE_STM32WB1"))
26 {
27 in_file = "tl_mbox_extended_wb1.x.in";
28 } else {
29 in_file = "tl_mbox_extended_wbx5.x.in";
30 }
31 } else {
32 in_file = "tl_mbox.x.in";
33 }
34 fs::write(out_file, fs::read_to_string(in_file).unwrap()).unwrap();
22 println!("cargo:rustc-link-search={}", out_dir.display()); 35 println!("cargo:rustc-link-search={}", out_dir.display());
23 println!("cargo:rerun-if-changed=tl_mbox.x.in"); 36 println!("cargo:rerun-if-changed={}", in_file);
24} 37}
25 38
26enum GetOneError { 39enum GetOneError {