Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Nov 8, 2023
1 parent d232b64 commit f4ac3ca
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 62 deletions.
10 changes: 4 additions & 6 deletions esp-hal-common/src/analog/adc/riscv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,6 @@ macro_rules! impl_adc_interface {
}
}

pub use implementation::*;

#[cfg(esp32c2)]
mod implementation {
//! # Analog to digital (ADC) conversion support.
Expand Down Expand Up @@ -722,7 +720,7 @@ mod implementation {
//! }
//! ```
pub use crate::analog::ADC1;
use crate::analog::ADC1;

impl_adc_interface! {
ADC1 [
Expand Down Expand Up @@ -769,7 +767,7 @@ mod implementation {
//! }
//! ```
pub use crate::analog::{ADC1, ADC2};
use crate::analog::{ADC1, ADC2};

impl_adc_interface! {
ADC1 [
Expand Down Expand Up @@ -821,7 +819,7 @@ mod implementation {
//! }
//! ```
pub use crate::analog::ADC1;
use crate::analog::ADC1;

impl_adc_interface! {
ADC1 [
Expand Down Expand Up @@ -869,7 +867,7 @@ mod implementation {
//! }
//! ```
pub use crate::analog::ADC1;
use crate::analog::ADC1;

impl_adc_interface! {
ADC1 [
Expand Down
6 changes: 6 additions & 0 deletions esp-hal-common/src/dma/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,11 +1153,13 @@ pub(crate) mod asynch {
}
}

#[cfg(any(i2s0, i2s1))]
pub struct DmaTxDoneChFuture<'a, TX> {
pub(crate) tx: &'a mut TX,
_a: (),
}

#[cfg(any(i2s0, i2s1))]
impl<'a, TX> DmaTxDoneChFuture<'a, TX>
where
TX: Tx,
Expand All @@ -1168,6 +1170,7 @@ pub(crate) mod asynch {
}
}

#[cfg(any(i2s0, i2s1))]
impl<'a, TX> core::future::Future for DmaTxDoneChFuture<'a, TX>
where
TX: Tx,
Expand All @@ -1187,11 +1190,13 @@ pub(crate) mod asynch {
}
}

#[cfg(any(i2s0, i2s1))]
pub struct DmaRxDoneChFuture<'a, RX> {
pub(crate) rx: &'a mut RX,
_a: (),
}

#[cfg(any(i2s0, i2s1))]
impl<'a, RX> DmaRxDoneChFuture<'a, RX>
where
RX: Rx,
Expand All @@ -1202,6 +1207,7 @@ pub(crate) mod asynch {
}
}

#[cfg(any(i2s0, i2s1))]
impl<'a, RX> core::future::Future for DmaRxDoneChFuture<'a, RX>
where
RX: Rx,
Expand Down
6 changes: 3 additions & 3 deletions esp-hal-common/src/embassy/time_driver_timg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ impl EmbassyTimer {

pub(crate) fn set_alarm(
&self,
alarm: embassy_time::driver::AlarmHandle,
_alarm: embassy_time::driver::AlarmHandle,
timestamp: u64,
) -> bool {
critical_section::with(|cs| {
critical_section::with(|_cs| {
// The hardware fires the alarm even if timestamp is lower than the current
// time. In this case the interrupt handler will pend a wakeup when we exit the
// critical section.
#[cfg(any(esp32, esp32s2, esp32s3))]
if alarm.id() == 1 {
if _alarm.id() == 1 {
let mut tg = unsafe { Timer1::<TIMG0>::steal() };
Self::arm(&mut tg, timestamp);
return;
Expand Down
2 changes: 1 addition & 1 deletion esp-hal-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#![cfg_attr(xtensa, feature(asm_experimental_arch))]
#![cfg_attr(
feature = "async",
allow(incomplete_features),
allow(incomplete_features, stable_features, unknown_lints, async_fn_in_trait),
feature(async_fn_in_trait),
feature(impl_trait_projections)
)]
Expand Down
2 changes: 1 addition & 1 deletion esp32-hal/examples/embassy_i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use esp32_hal::{
embassy::{self},
i2c::I2C,
interrupt,
peripherals::{Interrupt, Peripherals, I2C0},
peripherals::{Interrupt, Peripherals},
prelude::*,
timer::TimerGroup,
IO,
Expand Down
2 changes: 1 addition & 1 deletion esp32-hal/examples/spi_eh1_device_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use esp32_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi, SpiBusController},
master::{Spi, SpiBusController},
SpiMode,
},
Delay,
Expand Down
5 changes: 1 addition & 4 deletions esp32-hal/examples/spi_eh1_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ use esp32_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down
2 changes: 1 addition & 1 deletion esp32-hal/examples/spi_halfduplex_read_manufacturer_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use esp32_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Address, Command, HalfDuplexReadWrite, Spi},
master::{Address, Command, HalfDuplexReadWrite, Spi},
SpiDataMode,
SpiMode,
},
Expand Down
5 changes: 1 addition & 4 deletions esp32-hal/examples/spi_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ use esp32_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down
2 changes: 1 addition & 1 deletion esp32c2-hal/examples/spi_eh1_device_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use esp32c2_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi, SpiBusController},
master::{Spi, SpiBusController},
SpiMode,
},
Delay,
Expand Down
5 changes: 1 addition & 4 deletions esp32c2-hal/examples/spi_eh1_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ use esp32c2_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use esp32c2_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Address, Command, HalfDuplexReadWrite, Spi},
master::{Address, Command, HalfDuplexReadWrite, Spi},
SpiDataMode,
SpiMode,
},
Expand Down
5 changes: 1 addition & 4 deletions esp32c2-hal/examples/spi_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ use esp32c2_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down
1 change: 0 additions & 1 deletion esp32c3-hal/examples/embassy_hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use embassy_executor::Spawner;
use embassy_time::{Duration, Timer};
use esp32c3_hal::{clock::ClockControl, embassy, peripherals::Peripherals, prelude::*};
use esp_backtrace as _;
use static_cell::make_static;

#[embassy_executor::task]
async fn run() {
Expand Down
2 changes: 1 addition & 1 deletion esp32c3-hal/examples/spi_eh1_device_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use esp32c3_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi, SpiBusController},
master::{Spi, SpiBusController},
SpiMode,
},
Delay,
Expand Down
5 changes: 1 addition & 4 deletions esp32c3-hal/examples/spi_eh1_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ use esp32c3_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use esp32c3_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Address, Command, HalfDuplexReadWrite, Spi},
master::{Address, Command, HalfDuplexReadWrite, Spi},
SpiDataMode,
SpiMode,
},
Expand Down
5 changes: 1 addition & 4 deletions esp32c3-hal/examples/spi_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ use esp32c3_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down
2 changes: 1 addition & 1 deletion esp32c6-hal/examples/spi_eh1_device_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use esp32c6_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi, SpiBusController},
master::{Spi, SpiBusController},
SpiMode,
},
Delay,
Expand Down
5 changes: 1 addition & 4 deletions esp32c6-hal/examples/spi_eh1_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ use esp32c6_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use esp32c6_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Address, Command, HalfDuplexReadWrite, Spi},
master::{Address, Command, HalfDuplexReadWrite, Spi},
SpiDataMode,
SpiMode,
},
Expand Down
5 changes: 1 addition & 4 deletions esp32c6-hal/examples/spi_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ use esp32c6_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down
2 changes: 1 addition & 1 deletion esp32h2-hal/examples/spi_eh1_device_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use esp32h2_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi, SpiBusController},
master::{Spi, SpiBusController},
SpiMode,
},
Delay,
Expand Down
5 changes: 1 addition & 4 deletions esp32h2-hal/examples/spi_eh1_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ use esp32h2_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use esp32h2_hal::{
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Address, Command, HalfDuplexReadWrite, Spi},
master::{Address, Command, HalfDuplexReadWrite, Spi},
SpiDataMode,
SpiMode,
},
Expand Down
5 changes: 1 addition & 4 deletions esp32h2-hal/examples/spi_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ use esp32h2_hal::{
gpio::IO,
peripherals::Peripherals,
prelude::*,
spi::{
master::{prelude::*, Spi},
SpiMode,
},
spi::{master::Spi, SpiMode},
Delay,
};
use esp_backtrace as _;
Expand Down

0 comments on commit f4ac3ca

Please sign in to comment.