Make have_basepri an expected cfg

Since Rust 1.80 there is automatic compile-time checks for unexpected
cfgs.

Ensure that `have_basepri` cfg is known by the compiler emitting it in
the build.rs.
This commit is contained in:
Pontus Andersson 2024-11-05 10:35:26 +01:00
parent 1c5db277e4
commit 035ecb565c
2 changed files with 5 additions and 0 deletions

View file

@ -11,6 +11,8 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top!
### Fixed ### Fixed
- CFG: Make `have_basepri` an expected cfg
### Changed ### Changed
## [v1.1.4] - 2023-02-26 ## [v1.1.4] - 2023-02-26

View file

@ -7,6 +7,9 @@ fn main() {
println!("cargo:rustc-cfg=rustc_is_nightly"); println!("cargo:rustc-cfg=rustc_is_nightly");
} }
// Make `have_basepri` an expected cfg.
println!("cargo::rustc-check-cfg=cfg(have_basepri)");
// These targets all have know support for the BASEPRI register. // These targets all have know support for the BASEPRI register.
if target.starts_with("thumbv7m") if target.starts_with("thumbv7m")
| target.starts_with("thumbv7em") | target.starts_with("thumbv7em")