diff --git a/src/touch.rs b/src/touch.rs index 3a2f776a6fc..3d32caaf15d 100644 --- a/src/touch.rs +++ b/src/touch.rs @@ -87,7 +87,7 @@ pub struct TouchPadDriver where T: BorrowMut, { - touch: T, + _touch: T, pad: TouchPad, } @@ -96,7 +96,7 @@ impl TouchPadDriver { let mut touch = TouchDriver::new(config)?; esp!(unsafe { touch_pad_config(pad.into()) })?; touch.start()?; - Ok(Self { touch, pad }) + Ok(Self { _touch: touch, pad }) } } @@ -134,6 +134,6 @@ impl TouchDriver { #[cfg(any(esp32, esp32s2, esp32s3))] impl Drop for TouchDriver { fn drop(&mut self) { - unsafe { touch_pad_fsm_stop() }; + esp!(unsafe { touch_pad_fsm_stop() }).unwrap() } }