main
John Lauer Software 1.3.1: test-stage firmware (J4 TMC2209, HOME, limits, self-test), Stage tab and Calibrate in smi-dash (simulat… c0c5c9b
// SPDX-License-Identifier: MIT
// Compiles the firmware's control and stage cores into the dashboard so the simulator
// enforces exactly the limits the Pico does.
fn main() {
    let fw = "../firmware/src";
    for f in ["smi_ctl.c", "smi_ctl.h", "smi_controls_gen.h", "smi_stage.c", "smi_stage.h"] {
        println!("cargo:rerun-if-changed={fw}/{f}");
    }
    println!("cargo:rerun-if-changed=csrc/ctl_shim.c");
    println!("cargo:rerun-if-changed=csrc/stage_shim.c");
    println!("cargo:rerun-if-changed=assets/controls.json");
    cc::Build::new().file(format!("{fw}/smi_ctl.c")).file("csrc/ctl_shim.c").file(format!("{fw}/smi_stage.c")).file("csrc/stage_shim.c").include(fw).opt_level(2).warnings(true).compile("smi_ctl");
}