aboutsummaryrefslogtreecommitdiff
path: root/tests/mspm0/build.rs
diff options
context:
space:
mode:
authori509VCB <[email protected]>2025-04-06 21:13:49 -0500
committeri509VCB <[email protected]>2025-04-06 21:15:42 -0500
commit1e23b8114bb1f4b9e092bc50b3cfe4bd2f7ebdb6 (patch)
tree78f39de51ef1e399b9e4b0d3786a095134838790 /tests/mspm0/build.rs
parent717fbc1cd9a038d6601721a6e84f58be264ee624 (diff)
mspm0: add uart tests
This also fixes a bug in the uart clock calculation where it could select an oversampling faster than what the hardware is providing.
Diffstat (limited to 'tests/mspm0/build.rs')
-rw-r--r--tests/mspm0/build.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/mspm0/build.rs b/tests/mspm0/build.rs
new file mode 100644
index 000000000..57b592abf
--- /dev/null
+++ b/tests/mspm0/build.rs
@@ -0,0 +1,24 @@
1use std::error::Error;
2use std::path::PathBuf;
3use std::{env, fs};
4
5fn main() -> Result<(), Box<dyn Error>> {
6 let out = PathBuf::from(env::var("OUT_DIR").unwrap());
7
8 #[cfg(feature = "mspm0g3507")]
9 let memory_x = include_bytes!("memory_g3507.x");
10
11 fs::write(out.join("memory.x"), memory_x).unwrap();
12
13 println!("cargo:rustc-link-search={}", out.display());
14 println!("cargo:rerun-if-changed=link_ram.x");
15 // copy main linker script.
16 fs::write(out.join("link_ram.x"), include_bytes!("../link_ram_cortex_m.x")).unwrap();
17
18 println!("cargo:rustc-link-arg-bins=--nmagic");
19 println!("cargo:rustc-link-arg-bins=-Tlink_ram.x");
20 println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
21 println!("cargo:rustc-link-arg-bins=-Tteleprobe.x");
22
23 Ok(())
24}