From 2d0106994d154fc5aee7217eb8616642f1fa5d20 Mon Sep 17 00:00:00 2001 From: Frederick Vollbrecht Date: Fri, 24 Nov 2023 02:57:19 +0100 Subject: [PATCH] ivan i am a sinner --- src/gpio.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gpio.rs b/src/gpio.rs index 1992951fefa..1d381d9c3cf 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -843,16 +843,18 @@ impl<'d, T: Pin, MODE> PinDriver<'d, T, MODE> { where T: Pin, { + let pin = unsafe { self.pin.clone_unchecked() }; - gpio_reset_without_pull(pin.pin())?; + core::mem::forget(self); + //gpio_reset_without_pull(pin.pin())?; - if mode != gpio_mode_t_GPIO_MODE_DISABLE { - esp!(unsafe { gpio_set_direction(pin.pin(), mode) })?; - } + //if mode != gpio_mode_t_GPIO_MODE_DISABLE { + // esp!(unsafe { gpio_set_direction(pin.pin(), mode) })?; + //} Ok(PinDriver { - pin, + pin: pin, _mode: PhantomData, }) }