vibe-code wokwi display ch1115 integration
This commit was merged in pull request #55.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
fn main() {
|
||||
generate_filter_snippet();
|
||||
compile_custom_wokwi_components();
|
||||
linker_be_nice();
|
||||
// make sure linkall.x is the last linker script (otherwise might cause problems with flip-link)
|
||||
println!("cargo:rustc-link-arg=-Tlinkall.x");
|
||||
@@ -70,6 +71,28 @@ fn linker_be_nice() {
|
||||
);
|
||||
}
|
||||
|
||||
fn compile_custom_wokwi_components() {
|
||||
use std::process::Command;
|
||||
|
||||
if std::env::var("CARGO_FEATURE_WOKWI").is_ok() {
|
||||
println!("cargo:rerun-if-changed=wokwi/ch1115.chip.c");
|
||||
println!("cargo:rerun-if-changed=wokwi/ch1115.chip.json");
|
||||
println!("cargo:rerun-if-changed=wokwi/Makefile");
|
||||
|
||||
let status = Command::new("make")
|
||||
.current_dir("wokwi")
|
||||
.status()
|
||||
.expect("Failed to execute make command. Is 'make' installed?");
|
||||
|
||||
if !status.success() {
|
||||
panic!(
|
||||
"Wokwi custom chip compilation failed with status: {}",
|
||||
status
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Taken over from esp_println because impossible to just extend their existing env logger.
|
||||
// https://github.com/esp-rs/esp-hal/blob/8fa6d7e985e724d6ad998e34307429b0920da370/esp-println/build.rs
|
||||
fn generate_filter_snippet() {
|
||||
|
||||
Reference in New Issue
Block a user