Validate configuration through its owning schemas and keep board declarations separate from shared F722 resource ownership. Bound USB transitions, isolate transport failures and retain restart-only activation. Migrate navigation and flight consumers with the sensor and schema contracts. Require explicit installation data and synchronous output authority; board motor outputs remain inhibited. Validation: assembled-prefix host tests, strict Clippy, platform/USB tests and both ARM release builds. Final-source coverage and scoped Miri/Kani evidence are retained separately from hardware qualification.
27 lines
1.2 KiB
Rust
27 lines
1.2 KiB
Rust
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
let manifest_directory = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
|
|
let definitions = manifest_directory.join("definitions");
|
|
let dialect = definitions.join("kaptan.xml");
|
|
println!("cargo::rerun-if-changed={}", definitions.display());
|
|
// The generator emits these feature gates, but this crate leaves them disabled.
|
|
println!("cargo::rustc-check-cfg=cfg(feature, values(\"serde\", \"arbitrary\", \"ts-rs\"))");
|
|
let output_directory = std::env::var("OUT_DIR").unwrap();
|
|
mavlink_bindgen::generate(
|
|
mavlink_bindgen::XmlDefinitions::Files(vec![dialect]),
|
|
&output_directory,
|
|
)
|
|
.unwrap();
|
|
// Bypass bindgen's feature-gated index to load the Kaptan dialect unconditionally.
|
|
std::fs::write(
|
|
PathBuf::from(output_directory).join("kaptan_module.rs"),
|
|
"#[allow(non_camel_case_types, non_snake_case)]\n\
|
|
#[allow(clippy::derive_partial_eq_without_eq, clippy::field_reassign_with_default)]\n\
|
|
#[allow(clippy::unnecessary_cast, clippy::bad_bit_mask)]\n\
|
|
#[allow(clippy::suspicious_else_formatting)]\n\
|
|
#[path = \"kaptan.rs\"]\npub mod kaptan;\n",
|
|
)
|
|
.unwrap();
|
|
}
|