Skip to content

Commit

Permalink
Initial support for CLIC (#1112)
Browse files Browse the repository at this point in the history
* Initial support for CLIC

* CHANGELOG.md entry

* Explain MCAUSE CSR for CLIC
  • Loading branch information
bjoernQ authored Jan 25, 2024
1 parent f542eb4 commit de54a17
Show file tree
Hide file tree
Showing 6 changed files with 248 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add initial support for the ESP32-P4 (#1101)
- Implement `embedded_hal::pwm::SetDutyCycle` trait for `ledc::channel::Channel` (#1097)
- ESP32-P4: Add initial GPIO support (#1109)
- ESP32-P4: Add initial support for interrupts (#1112)

### Fixed

Expand Down
10 changes: 9 additions & 1 deletion esp-hal-common/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ macro_rules! assert_unique_used_features {
}
}

#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, PartialEq)]
enum Arch {
#[serde(rename = "riscv")]
RiscV,
Expand Down Expand Up @@ -177,6 +177,14 @@ fn main() -> Result<(), Box<dyn Error>> {
panic!("The target does not support PSRAM");
}

// Don't support "interrupt-preemption" and "direct-vectoring" on Xtensa and
// RISCV-clic
if (*&device.symbols.contains(&String::from("clic")) || device.arch == Arch::Xtensa)
&& (cfg!(feature = "direct-vectoring") || cfg!(feature = "interrupt-preemption"))
{
panic!("The target does not support interrupt-preemption and direct-vectoring");
}

// Define all necessary configuration symbols for the configured device:
println!("cargo:rustc-cfg={}", device_name);
println!("cargo:rustc-cfg={}", device.arch);
Expand Down
3 changes: 2 additions & 1 deletion esp-hal-common/devices/esp32p4/device.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,6 @@ peripherals = [

symbols = [
# Additional peripherals defined by us (the developers):
"plic",
"clic",
"very_large_intr_status",
]
Loading

0 comments on commit de54a17

Please sign in to comment.