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, }) }