From 7386ec0b082dccf215cb227e2a42eeea628a4db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Sat, 12 Oct 2024 13:10:25 +0200 Subject: [PATCH] Add missing PeripheralRef impl --- esp-hal/src/peripheral.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/esp-hal/src/peripheral.rs b/esp-hal/src/peripheral.rs index eb28f3ed8fb..abcc2bb5f9e 100644 --- a/esp-hal/src/peripheral.rs +++ b/esp-hal/src/peripheral.rs @@ -182,6 +182,16 @@ where } impl crate::private::Sealed for &mut T where T: crate::private::Sealed {} +impl crate::private::Sealed for PeripheralRef<'_, T> where T: crate::private::Sealed {} + +impl Peripheral for PeripheralRef<'_, T> { + type P = T::P; + + #[inline] + unsafe fn clone_unchecked(&self) -> Self::P { + T::clone_unchecked(self) + } +} mod peripheral_macros { #[doc(hidden)]