Skip to content

Commit

Permalink
ivan i am a sinner
Browse files Browse the repository at this point in the history
  • Loading branch information
Vollbrecht committed Nov 24, 2023
1 parent 9b316f4 commit 2d01069
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}
Expand Down

0 comments on commit 2d01069

Please sign in to comment.