mirror of
https://github.com/esp-rs/esp-idf-hal.git
synced 2025-09-27 04:10:30 +00:00
Protect the legacy example; do not make the oneshot_legacy mod an API (yet)
This commit is contained in:
parent
e3e8a37807
commit
16823abd7d
@ -6,11 +6,12 @@ use esp_idf_sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
use esp_idf_hal::adc::config::Config;
|
||||
use esp_idf_hal::adc::*;
|
||||
use esp_idf_hal::peripherals::Peripherals;
|
||||
|
||||
#[cfg(not(feature = "adc-oneshot-new"))]
|
||||
fn main() -> anyhow::Result<()> {
|
||||
use esp_idf_hal::adc::config::Config;
|
||||
use esp_idf_hal::adc::*;
|
||||
use esp_idf_hal::peripherals::Peripherals;
|
||||
|
||||
let peripherals = Peripherals::take()?;
|
||||
|
||||
#[cfg(not(esp32))]
|
||||
@ -35,3 +36,12 @@ fn main() -> anyhow::Result<()> {
|
||||
println!("ADC value: {}", adc.read(&mut adc_pin)?);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "adc-oneshot-new")]
|
||||
fn main() -> anyhow::Result<()> {
|
||||
println!("This example requires feature `adc-oneshot-new` disabled");
|
||||
|
||||
loop {
|
||||
thread::sleep(Duration::from_millis(1000));
|
||||
}
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ impl_adc!(ADC2: adc_unit_t_ADC_UNIT_2);
|
||||
not(esp_idf_version_major = "4"),
|
||||
esp_idf_comp_esp_adc_enabled
|
||||
))]
|
||||
pub mod oneshot {
|
||||
mod oneshot {
|
||||
use core::borrow::Borrow;
|
||||
|
||||
use esp_idf_sys::*;
|
||||
|
Loading…
x
Reference in New Issue
Block a user