This commit is contained in:
ivmarkov 2025-01-15 18:06:58 +00:00
parent 9de95e1886
commit 098b77b076
2 changed files with 3 additions and 2 deletions

View File

@ -385,8 +385,8 @@ mod oneshot_legacy {
} }
#[cfg(all(esp32, esp_idf_version_major = "4"))] #[cfg(all(esp32, esp_idf_version_major = "4"))]
impl<'d> embedded_hal_0_2::adc::OneShot<super::ADC1, u16, crate::hall::HallSensor> impl embedded_hal_0_2::adc::OneShot<super::ADC1, u16, crate::hall::HallSensor>
for AdcDriver<'d, super::ADC1> for AdcDriver<'_, super::ADC1>
{ {
type Error = EspError; type Error = EspError;

View File

@ -33,6 +33,7 @@ const XTAL_TICK_PERIOD_NS: u32 = 1_000_000_000 / XTAL_CLK_FREQ;
pub struct APBTickType(::core::ffi::c_int); pub struct APBTickType(::core::ffi::c_int);
impl From<Duration> for APBTickType { impl From<Duration> for APBTickType {
#[cfg(any(esp32, esp32s2))] #[cfg(any(esp32, esp32s2))]
#[allow(clippy::manual_div_ceil)]
fn from(duration: Duration) -> Self { fn from(duration: Duration) -> Self {
APBTickType( APBTickType(
((duration.as_nanos() + APB_TICK_PERIOD_NS as u128 - 1) / APB_TICK_PERIOD_NS as u128) ((duration.as_nanos() + APB_TICK_PERIOD_NS as u128 - 1) / APB_TICK_PERIOD_NS as u128)