From 496d42edfa828f2db0e7350685b39e28085fe22a Mon Sep 17 00:00:00 2001 From: ivmarkov Date: Mon, 18 Sep 2023 04:37:02 +0000 Subject: [PATCH] new constructor; take config by ref --- src/adc.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/adc.rs b/src/adc.rs index 3cbee584251..7a79f256879 100644 --- a/src/adc.rs +++ b/src/adc.rs @@ -476,6 +476,12 @@ pub mod oneshot { #[cfg(any(esp_idf_comp_esp_adc_cal_enabled, esp_idf_comp_esp_adc_enabled))] pub calibration: bool, } + + impl AdcChannelConfig { + pub fn new() -> Self { + Default::default() + } + } } pub struct AdcChannelDriver<'d, T, M> @@ -496,7 +502,7 @@ pub mod oneshot { pub fn new( adc: M, pin: impl Peripheral

+ 'd, - config: config::AdcChannelConfig, + config: &config::AdcChannelConfig, ) -> Result { crate::into_ref!(pin);