Skip to content

Commit

Permalink
new constructor; take config by ref
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Sep 18, 2023
1 parent 95dfc2f commit 496d42e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -496,7 +502,7 @@ pub mod oneshot {
pub fn new(
adc: M,
pin: impl Peripheral<P = T> + 'd,
config: config::AdcChannelConfig,
config: &config::AdcChannelConfig,
) -> Result<Self, EspError> {
crate::into_ref!(pin);

Expand Down

0 comments on commit 496d42e

Please sign in to comment.