mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-29 21:30:39 +00:00
Compare functions by their address (#3650)
* Compare functions by their address * Remove traits
This commit is contained in:
parent
6e74add2a0
commit
150b57f03f
@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
- `InterruptHandler` no longer implements `PartialEq`, `Eq` or `Hash`. (#3650)
|
||||||
|
|
||||||
## [v1.0.0-beta.1] - 2025-06-03
|
## [v1.0.0-beta.1] - 2025-06-03
|
||||||
|
|
||||||
|
@ -94,11 +94,9 @@ impl CFnPtr {
|
|||||||
pub(crate) fn bind_default_interrupt_handler() {
|
pub(crate) fn bind_default_interrupt_handler() {
|
||||||
// We first check if a handler is set in the vector table.
|
// We first check if a handler is set in the vector table.
|
||||||
if let Some(handler) = interrupt::bound_handler(Interrupt::GPIO) {
|
if let Some(handler) = interrupt::bound_handler(Interrupt::GPIO) {
|
||||||
let handler = handler as *const unsafe extern "C" fn();
|
|
||||||
|
|
||||||
// We only allow binding the default handler if nothing else is bound.
|
// We only allow binding the default handler if nothing else is bound.
|
||||||
// This prevents silently overwriting RTIC's interrupt handler, if using GPIO.
|
// This prevents silently overwriting RTIC's interrupt handler, if using GPIO.
|
||||||
if !core::ptr::eq(handler, DEFAULT_INTERRUPT_HANDLER.handler() as _) {
|
if !core::ptr::fn_addr_eq(handler, DEFAULT_INTERRUPT_HANDLER.handler()) {
|
||||||
// The user has configured an interrupt handler they wish to use.
|
// The user has configured an interrupt handler they wish to use.
|
||||||
info!("Not using default GPIO interrupt handler: already bound in vector table");
|
info!("Not using default GPIO interrupt handler: already bound in vector table");
|
||||||
return;
|
return;
|
||||||
|
@ -122,7 +122,7 @@ pub trait InterruptConfigurable: crate::private::Sealed {
|
|||||||
multi_core,
|
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."
|
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, Hash)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
pub struct InterruptHandler {
|
pub struct InterruptHandler {
|
||||||
f: extern "C" fn(),
|
f: extern "C" fn(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user