First commit

This commit is contained in:
2021-10-08 21:40:40 +02:00
commit 7403b5e53f
6 changed files with 78 additions and 0 deletions

26
build.rs Normal file
View File

@@ -0,0 +1,26 @@
use std::path::PathBuf;
use embuild::{
self, bingen,
build::{CfgArgs, LinkArgs},
cargo, symgen,
};
// Necessary because of this issue: https://github.com/rust-lang/cargo/issues/9641
fn main() -> anyhow::Result<()> {
LinkArgs::output_propagated("ESP_IDF")?;
let cfg = CfgArgs::try_from_env("ESP_IDF")?;
if cfg.get("esp32s2").is_some() {
let ulp_elf = PathBuf::from("ulp").join("rust-esp32-ulp-hello");
symgen::run(&ulp_elf, 0x5000_0000)?; // This is where the RTC Slow Mem is mapped within the ESP32-S2 memory space
bingen::run(&ulp_elf)?;
cargo::track_file(ulp_elf);
}
cfg.output();
Ok(())
}