mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-27 04:10:28 +00:00
Don't check chip when building documentation (#3605)
This commit is contained in:
parent
d34aab3ecd
commit
ec237026fd
@ -10,9 +10,6 @@ license = "MIT OR Apache-2.0"
|
||||
keywords = ["lx", "peripheral", "register", "xtensa"]
|
||||
categories = ["embedded", "hardware-support", "no-std"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["esp32"]
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
test = false
|
||||
|
@ -105,22 +105,29 @@ fn handle_esp32() -> Result<()> {
|
||||
})
|
||||
}
|
||||
|
||||
// Based on the build target, determine which chip to use.
|
||||
let target = std::env::var("TARGET");
|
||||
let target = target.as_deref().unwrap_or("unspecified target");
|
||||
let Some(chip) = Chip::TARGET_TO_CHIP
|
||||
.iter()
|
||||
.copied()
|
||||
.find_map(|(t, chip)| (t == target).then_some(chip))
|
||||
else {
|
||||
panic!(
|
||||
"Unsupported target: {target}. Expected one of: {}",
|
||||
Chip::TARGET_TO_CHIP
|
||||
.iter()
|
||||
.map(|(t, _)| t.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
);
|
||||
// Do not check target when building documentation
|
||||
let chip = if std::env::var("RUSTDOCFLAGS").is_err() {
|
||||
// Based on the build target, determine which chip to use.
|
||||
let target = std::env::var("TARGET");
|
||||
let target = target.as_deref().unwrap_or("unspecified target");
|
||||
let Some(chip) = Chip::TARGET_TO_CHIP
|
||||
.iter()
|
||||
.copied()
|
||||
.find_map(|(t, chip)| (t == target).then_some(chip))
|
||||
else {
|
||||
panic!(
|
||||
"Unsupported target: {target}. Expected one of: {}",
|
||||
Chip::TARGET_TO_CHIP
|
||||
.iter()
|
||||
.map(|(t, _)| t.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
);
|
||||
};
|
||||
chip
|
||||
} else {
|
||||
// For documentation purposes, we use ESP32
|
||||
Chip::Esp32
|
||||
};
|
||||
|
||||
let isa_toml = fs::read_to_string(format!("config/{chip}.toml"))?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user