diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index e7104cd77..e2afa242c 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `{DmaRxBuf, DmaTxBuf, DmaRxTxBuf}::set_burst_config` (#2543) - ESP32-S2: DMA support for AES (#2699) - Added `transfer_in_place_async` and embedded-hal-async implementation to `Spi` (#2691) +- `InterruptHandler` now implements `Hash` and `defmt::Format` (#2830) ### Changed diff --git a/esp-hal/src/interrupt/mod.rs b/esp-hal/src/interrupt/mod.rs index 693141c1c..d5f37bd90 100644 --- a/esp-hal/src/interrupt/mod.rs +++ b/esp-hal/src/interrupt/mod.rs @@ -118,7 +118,8 @@ pub trait InterruptConfigurable: crate::private::Sealed { multi_core, doc = "**Note**: Interrupts are handled on the core they were setup on, if a driver is initialized on core 0, and moved to core 1, core 0 will still handle the interrupt." )] -#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub struct InterruptHandler { f: extern "C" fn(), prio: Priority, diff --git a/esp-hal/src/interrupt/riscv.rs b/esp-hal/src/interrupt/riscv.rs index 1d7805443..1aaa3eddd 100644 --- a/esp-hal/src/interrupt/riscv.rs +++ b/esp-hal/src/interrupt/riscv.rs @@ -117,7 +117,7 @@ pub enum CpuInterrupt { } /// Interrupt priority levels. -#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[repr(u8)] pub enum Priority { diff --git a/esp-hal/src/interrupt/xtensa.rs b/esp-hal/src/interrupt/xtensa.rs index c08e64e4e..7bf72e855 100644 --- a/esp-hal/src/interrupt/xtensa.rs +++ b/esp-hal/src/interrupt/xtensa.rs @@ -372,7 +372,7 @@ mod vectored { use super::*; /// Interrupt priority levels. - #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] + #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[repr(u8)] pub enum Priority {