mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-27 12:20:56 +00:00

* First draft of multicore strategies implementation * Implemented second core active detection mechanism Removed dependency to esp-hal * Guarded flash unlock as well Made esp_metadata_generated only check for chips if not building with "emulation" Added more documentation * Applied suggestions * Restored second core active detection for esp32 * Flipped check of stall condition on esp32 * Implement defmt::Format and common traits --------- Co-authored-by: Dániel Buga <bugadani@gmail.com>
28 lines
903 B
Rust
28 lines
903 B
Rust
use esp_metadata_generated::Chip;
|
|
|
|
fn main() -> Result<(), String> {
|
|
if !cfg!(feature = "emulation") {
|
|
// Load the configuration file for the configured device:
|
|
let chip = Chip::from_cargo_feature()?;
|
|
|
|
// Define all necessary configuration symbols for the configured device:
|
|
chip.define_cfgs();
|
|
}
|
|
if cfg!(feature = "esp32") {
|
|
match std::env::var("OPT_LEVEL") {
|
|
Ok(level) if std::env::var("CI").is_err() => {
|
|
if level != "2" && level != "3" && level != "s" {
|
|
Err(format!(
|
|
"Building esp-storage for ESP32 needs optimization level 2, 3 or s - yours is {level}. See https://github.com/esp-rs/esp-storage"
|
|
))
|
|
} else {
|
|
Ok(())
|
|
}
|
|
}
|
|
_ => Ok(()),
|
|
}
|
|
} else {
|
|
Ok(())
|
|
}
|
|
}
|