diff options
| author | goueslati <[email protected]> | 2023-06-12 14:27:53 +0100 |
|---|---|---|
| committer | goueslati <[email protected]> | 2023-06-12 14:27:53 +0100 |
| commit | 2d89cfb18f00aefbfa108728dfea3398e80ea3e4 (patch) | |
| tree | 6485dacac7e61c4378ac522e709edb0a86bd7523 /embassy-rp/src/interrupt.rs | |
| parent | 2dd5ce83ec0421564e85b667f5dabd592f313e5c (diff) | |
| parent | ab86b060500ceda1c80e39f35af69cb08a7b63a2 (diff) | |
fix merge conflict
Diffstat (limited to 'embassy-rp/src/interrupt.rs')
| -rw-r--r-- | embassy-rp/src/interrupt.rs | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/embassy-rp/src/interrupt.rs b/embassy-rp/src/interrupt.rs deleted file mode 100644 index c9298644d..000000000 --- a/embassy-rp/src/interrupt.rs +++ /dev/null | |||
| @@ -1,65 +0,0 @@ | |||
| 1 | //! Interrupt definitions and macros to bind them. | ||
| 2 | pub use cortex_m::interrupt::{CriticalSection, Mutex}; | ||
| 3 | use embassy_cortex_m::interrupt::_export::declare; | ||
| 4 | pub use embassy_cortex_m::interrupt::{Binding, Handler, Interrupt, Priority}; | ||
| 5 | |||
| 6 | use crate::pac::Interrupt as InterruptEnum; | ||
| 7 | declare!(TIMER_IRQ_0); | ||
| 8 | declare!(TIMER_IRQ_1); | ||
| 9 | declare!(TIMER_IRQ_2); | ||
| 10 | declare!(TIMER_IRQ_3); | ||
| 11 | declare!(PWM_IRQ_WRAP); | ||
| 12 | declare!(USBCTRL_IRQ); | ||
| 13 | declare!(XIP_IRQ); | ||
| 14 | declare!(PIO0_IRQ_0); | ||
| 15 | declare!(PIO0_IRQ_1); | ||
| 16 | declare!(PIO1_IRQ_0); | ||
| 17 | declare!(PIO1_IRQ_1); | ||
| 18 | declare!(DMA_IRQ_0); | ||
| 19 | declare!(DMA_IRQ_1); | ||
| 20 | declare!(IO_IRQ_BANK0); | ||
| 21 | declare!(IO_IRQ_QSPI); | ||
| 22 | declare!(SIO_IRQ_PROC0); | ||
| 23 | declare!(SIO_IRQ_PROC1); | ||
| 24 | declare!(CLOCKS_IRQ); | ||
| 25 | declare!(SPI0_IRQ); | ||
| 26 | declare!(SPI1_IRQ); | ||
| 27 | declare!(UART0_IRQ); | ||
| 28 | declare!(UART1_IRQ); | ||
| 29 | declare!(ADC_IRQ_FIFO); | ||
| 30 | declare!(I2C0_IRQ); | ||
| 31 | declare!(I2C1_IRQ); | ||
| 32 | declare!(RTC_IRQ); | ||
| 33 | declare!(SWI_IRQ_0); | ||
| 34 | declare!(SWI_IRQ_1); | ||
| 35 | declare!(SWI_IRQ_2); | ||
| 36 | declare!(SWI_IRQ_3); | ||
| 37 | declare!(SWI_IRQ_4); | ||
| 38 | declare!(SWI_IRQ_5); | ||
| 39 | |||
| 40 | /// Macro to bind interrupts to handlers. | ||
| 41 | /// | ||
| 42 | /// This defines the right interrupt handlers, and creates a unit struct (like `struct Irqs;`) | ||
| 43 | /// and implements the right [`Binding`]s for it. You can pass this struct to drivers to | ||
| 44 | /// prove at compile-time that the right interrupts have been bound. | ||
| 45 | // developer note: this macro can't be in `embassy-cortex-m` due to the use of `$crate`. | ||
| 46 | #[macro_export] | ||
| 47 | macro_rules! bind_interrupts { | ||
| 48 | ($vis:vis struct $name:ident { $($irq:ident => $($handler:ty),*;)* }) => { | ||
| 49 | $vis struct $name; | ||
| 50 | |||
| 51 | $( | ||
| 52 | #[allow(non_snake_case)] | ||
| 53 | #[no_mangle] | ||
| 54 | unsafe extern "C" fn $irq() { | ||
| 55 | $( | ||
| 56 | <$handler as $crate::interrupt::Handler<$crate::interrupt::$irq>>::on_interrupt(); | ||
| 57 | )* | ||
| 58 | } | ||
| 59 | |||
| 60 | $( | ||
| 61 | unsafe impl $crate::interrupt::Binding<$crate::interrupt::$irq, $handler> for $name {} | ||
| 62 | )* | ||
| 63 | )* | ||
| 64 | }; | ||
| 65 | } | ||
