firmware for my Touchscreen E-Paper Input Module for Framework Laptop 16
0

Configure Feed

Select the types of activity you want to include in your feed.

at main 774 B View raw
1use std::env; 2use std::path::Path; 3 4fn main() { 5 if env::var("TARGET").unwrap() != "thumbv6m-none-eabi" { 6 return; 7 } 8 9 let linker_script = std::fs::read_to_string("program.x").unwrap(); 10 let slot = env::var("EPD_PROG_SLOT").unwrap(); 11 let out_script = format!("SLOT_N = {slot};\n\n{linker_script}"); 12 13 let out_dir = env::var_os("OUT_DIR").unwrap(); 14 let out_dir = Path::new(&out_dir); 15 let out_file = out_dir.join("program.x"); 16 std::fs::write(out_file, &out_script).unwrap(); 17 18 println!("cargo::rerun-if-changed={}", out_dir.join("program.x").to_str().unwrap()); 19 println!("cargo::rustc-link-search={}", out_dir.to_str().unwrap()); 20 println!("cargo::rustc-link-arg=-Tprogram.x"); 21 println!("cargo::rustc-link-arg=--nmagic"); 22}