Skip to content

Commit

Permalink
Fix nightly clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
TethysSvensson committed Mar 5, 2024
1 parent b51fa84 commit f7bea76
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 15 deletions.
2 changes: 0 additions & 2 deletions hal/src/gpio/dynpin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@

use atsamd_hal_macros::{hal_cfg, hal_macro_helper};

use core::convert::TryFrom;

use paste::paste;

use crate::ehal::digital::v2::OutputPin;
Expand Down
2 changes: 0 additions & 2 deletions hal/src/rtc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ use void::Void;
#[cfg(feature = "sdmmc")]
use embedded_sdmmc::{TimeSource, Timestamp};

#[cfg(feature = "rtic")]
use fugit;
#[cfg(feature = "rtic")]
pub type Instant = fugit::Instant<u32, 1, 32_768>;
#[cfg(feature = "rtic")]
Expand Down
2 changes: 1 addition & 1 deletion hal/src/sercom/i2c/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use super::{I2c, InactiveTimeout, PadSet, Registers};
use crate::{
pac::sercom0::i2cm::ctrla::MODESELECT_A,
sercom::*,
sercom::{Sercom, APB_CLK_CTRL},
time::Hertz,
typelevel::{Is, Sealed},
};
Expand Down
6 changes: 6 additions & 0 deletions hal/src/sercom/i2c/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ pub enum BusState {
Busy = 0x03,
}

impl Default for Status {
fn default() -> Self {
Self::new()
}
}

/// Status flags for I2C transactions
///
/// The available status flags are `BUSERR`, `ARBLOST`, `RXNACK`,
Expand Down
2 changes: 1 addition & 1 deletion hal/src/sercom/i2c/reg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::flags::{BusState, Error};
use super::InactiveTimeout;
use super::{Flags, Status};
use crate::pac;
use crate::sercom::*;
use crate::sercom::Sercom;
use crate::time::Hertz;

const MASTER_ACT_READ: u8 = 2;
Expand Down
3 changes: 1 addition & 2 deletions hal/src/sercom/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,13 @@ let (chan0, _, spi, _) = dma_transfer.wait();

use atsamd_hal_macros::{hal_cfg, hal_docs, hal_macro_helper, hal_module};

use core::convert::TryFrom;
use core::marker::PhantomData;

use bitflags::bitflags;
use embedded_hal::spi;
pub use embedded_hal::spi::{Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3};

use crate::sercom::*;
use crate::sercom::{pad::SomePad, Sercom, APB_CLK_CTRL};
use crate::time::Hertz;
use crate::typelevel::{Is, NoneT, Sealed};

Expand Down
2 changes: 0 additions & 2 deletions hal/src/sercom/spi/reg.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use atsamd_hal_macros::{hal_cfg, hal_macro_helper};

use core::convert::TryInto;

use embedded_hal::spi;

#[hal_cfg(any("sercom0-d11", "sercom0-d21"))]
Expand Down
4 changes: 2 additions & 2 deletions hal/src/sercom/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ pub use config::*;

pub mod impl_ehal;

use crate::{sercom::*, typelevel::Sealed};
use core::{convert::TryInto, marker::PhantomData};
use crate::{sercom::pad::SomePad, typelevel::Sealed};
use core::marker::PhantomData;
use num_traits::AsPrimitive;

/// Size of the SERCOM's `DATA` register
Expand Down
2 changes: 1 addition & 1 deletion hal/src/sercom/uart/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{
};
use crate::{
pac,
sercom::*,
sercom::Sercom,
time::Hertz,
typelevel::{Is, Sealed},
};
Expand Down
1 change: 0 additions & 1 deletion hal/src/sercom/uart/flags.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Flag definitions
use bitflags::bitflags;
use core::convert::TryFrom;

//=============================================================================
// Interrupt flags
Expand Down
2 changes: 1 addition & 1 deletion hal/src/sercom/uart/reg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use atsamd_hal_macros::hal_cfg;
use super::{BaudMode, BitOrder, CharSizeEnum, Flags, Oversampling, Parity, Status, StopBits};

use crate::pac;
use crate::sercom::*;
use crate::sercom::Sercom;

#[hal_cfg(any("sercom0-d11", "sercom0-d21"))]
use pac::sercom0::usart::ctrla::MODESELECT_A;
Expand Down

0 comments on commit f7bea76

Please sign in to comment.