diff options
| author | Ralph Ursprung <[email protected]> | 2025-05-15 17:29:23 +0200 |
|---|---|---|
| committer | Ralph Ursprung <[email protected]> | 2025-05-15 18:38:04 +0200 |
| commit | 4a089fe2455f22f956455548816fcd96735e38d8 (patch) | |
| tree | bbd4184eb3a7215184871854b03ada1540238631 /embassy-hal-internal/src | |
| parent | 05bfbacee55207f8065b6e9bbbc0d5454e77668f (diff) | |
rp: add missing `Debug` and `defmt::Format` `derive`s for ADC
this doesn't cover every `struct` & co. in `embassy-rp`, but at least it
adds those needed for `Adc` and `adc::Channel`.
Diffstat (limited to 'embassy-hal-internal/src')
| -rw-r--r-- | embassy-hal-internal/src/macros.rs | 2 | ||||
| -rw-r--r-- | embassy-hal-internal/src/peripheral.rs | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/embassy-hal-internal/src/macros.rs b/embassy-hal-internal/src/macros.rs index cd2bc3cab..ce72ded5c 100644 --- a/embassy-hal-internal/src/macros.rs +++ b/embassy-hal-internal/src/macros.rs | |||
| @@ -8,6 +8,8 @@ macro_rules! peripherals_definition { | |||
| 8 | $(#[$cfg])? | 8 | $(#[$cfg])? |
| 9 | #[allow(non_camel_case_types)] | 9 | #[allow(non_camel_case_types)] |
| 10 | #[doc = concat!(stringify!($name), " peripheral")] | 10 | #[doc = concat!(stringify!($name), " peripheral")] |
| 11 | #[derive(Debug)] | ||
| 12 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 11 | pub struct $name { _private: () } | 13 | pub struct $name { _private: () } |
| 12 | 14 | ||
| 13 | $(#[$cfg])? | 15 | $(#[$cfg])? |
diff --git a/embassy-hal-internal/src/peripheral.rs b/embassy-hal-internal/src/peripheral.rs index 803259bb8..b1868caf6 100644 --- a/embassy-hal-internal/src/peripheral.rs +++ b/embassy-hal-internal/src/peripheral.rs | |||
| @@ -14,6 +14,8 @@ use core::ops::Deref; | |||
| 14 | /// the driver code would be monomorphized two times. With Peri, the driver is generic | 14 | /// the driver code would be monomorphized two times. With Peri, the driver is generic |
| 15 | /// over a lifetime only. `SPI4` becomes `Peri<'static, SPI4>`, and `&mut SPI4` becomes | 15 | /// over a lifetime only. `SPI4` becomes `Peri<'static, SPI4>`, and `&mut SPI4` becomes |
| 16 | /// `Peri<'a, SPI4>`. Lifetimes don't cause monomorphization. | 16 | /// `Peri<'a, SPI4>`. Lifetimes don't cause monomorphization. |
| 17 | #[derive(Debug)] | ||
| 18 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 17 | pub struct Peri<'a, T: PeripheralType> { | 19 | pub struct Peri<'a, T: PeripheralType> { |
| 18 | inner: T, | 20 | inner: T, |
| 19 | _lifetime: PhantomData<&'a mut T>, | 21 | _lifetime: PhantomData<&'a mut T>, |
