diff options
| author | Ralph Ursprung <[email protected]> | 2025-05-15 17:53:31 +0200 |
|---|---|---|
| committer | Ralph Ursprung <[email protected]> | 2025-05-15 18:27:40 +0200 |
| commit | 117eb45fa0829239da9152b9cf54c3cf706dc76d (patch) | |
| tree | 86eb9a1c2fdcba1efae1705299adbaeaa87884af /embassy-stm32 | |
| parent | d1c2ce927ac41a3f81de0f47e0468523d562d1d1 (diff) | |
add the possibility to document `bind_interrupts` `struct`s
the `bind_interrupts` macro creates a `struct` for the interrupts. it
was so far not possible to document those (except for STM32) and there
was no generic documentation being generated/added either, thus the
`missing_docs` lint was triggered for consumers which enabled it.
with this change it is now possible to manually add a comment on the
`struct` being defined in the macro invocation.
to show that this works one RP example has been modified accordingly.
Diffstat (limited to 'embassy-stm32')
| -rw-r--r-- | embassy-stm32/src/lib.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index f8d09413d..973acc9bb 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -163,11 +163,14 @@ pub use crate::_generated::interrupt; | |||
| 163 | /// ```rust,ignore | 163 | /// ```rust,ignore |
| 164 | /// use embassy_stm32::{bind_interrupts, i2c, peripherals}; | 164 | /// use embassy_stm32::{bind_interrupts, i2c, peripherals}; |
| 165 | /// | 165 | /// |
| 166 | /// bind_interrupts!(struct Irqs { | 166 | /// bind_interrupts!( |
| 167 | /// I2C1 => i2c::EventInterruptHandler<peripherals::I2C1>, i2c::ErrorInterruptHandler<peripherals::I2C1>; | 167 | /// /// Binds the I2C interrupts. |
| 168 | /// I2C2_3 => i2c::EventInterruptHandler<peripherals::I2C2>, i2c::ErrorInterruptHandler<peripherals::I2C2>, | 168 | /// struct Irqs { |
| 169 | /// i2c::EventInterruptHandler<peripherals::I2C3>, i2c::ErrorInterruptHandler<peripherals::I2C3>; | 169 | /// I2C1 => i2c::EventInterruptHandler<peripherals::I2C1>, i2c::ErrorInterruptHandler<peripherals::I2C1>; |
| 170 | /// }); | 170 | /// I2C2_3 => i2c::EventInterruptHandler<peripherals::I2C2>, i2c::ErrorInterruptHandler<peripherals::I2C2>, |
| 171 | /// i2c::EventInterruptHandler<peripherals::I2C3>, i2c::ErrorInterruptHandler<peripherals::I2C3>; | ||
| 172 | /// } | ||
| 173 | /// ); | ||
| 171 | /// ``` | 174 | /// ``` |
| 172 | 175 | ||
| 173 | // developer note: this macro can't be in `embassy-hal-internal` due to the use of `$crate`. | 176 | // developer note: this macro can't be in `embassy-hal-internal` due to the use of `$crate`. |
