Skip to content

Commit 5597dda

Browse files
Fix nightly clippy
1 parent a6670a1 commit 5597dda

File tree

14 files changed

+37
-15
lines changed

14 files changed

+37
-15
lines changed

hal/src/dmac/channel/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,12 @@ pub enum CallbackStatus {
358358
TransferSuspended,
359359
}
360360

361+
impl Default for InterruptFlags {
362+
fn default() -> Self {
363+
Self::new()
364+
}
365+
}
366+
361367
/// Interrupt sources available to a DMA channel
362368
#[bitfield]
363369
#[repr(u8)]

hal/src/dmac/dma_controller.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ pub struct DmaController {
8181
dmac: DMAC,
8282
}
8383

84+
impl Default for PriorityLevelMask {
85+
fn default() -> Self {
86+
Self::new()
87+
}
88+
}
89+
8490
/// Mask representing which priority levels should be enabled/disabled
8591
#[bitfield]
8692
#[repr(u16)]
@@ -103,6 +109,12 @@ pub struct PriorityLevelMask {
103109
_reserved: B4,
104110
}
105111

112+
impl Default for RoundRobinMask {
113+
fn default() -> Self {
114+
Self::new()
115+
}
116+
}
117+
106118
/// Mask representing which priority levels should be configured as round-robin
107119
#[bitfield]
108120
#[repr(u32)]

hal/src/dmac/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ macro_rules! get {
343343
pub const NUM_CHANNELS: usize = with_num_channels!(get);
344344

345345
// ----- DMAC SRAM registers ----- //
346+
impl Default for BlockTransferControl {
347+
fn default() -> Self {
348+
Self::new()
349+
}
350+
}
351+
346352
/// Bitfield representing the BTCTRL SRAM DMAC register
347353
#[bitfield]
348354
#[derive(Clone, Copy)]

hal/src/gpio/dynpin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161

6262
use atsamd_hal_macros::{hal_cfg, hal_macro_helper};
6363

64-
use core::convert::TryFrom;
65-
6664
use paste::paste;
6765

6866
use crate::ehal::digital::v2::OutputPin;

hal/src/rtc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ use void::Void;
1313
#[cfg(feature = "sdmmc")]
1414
use embedded_sdmmc::{TimeSource, Timestamp};
1515

16-
#[cfg(feature = "rtic")]
17-
use fugit;
1816
#[cfg(feature = "rtic")]
1917
pub type Instant = fugit::Instant<u32, 1, 32_768>;
2018
#[cfg(feature = "rtic")]

hal/src/sercom/i2c/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use super::{I2c, InactiveTimeout, PadSet, Registers};
44
use crate::{
55
pac::sercom0::i2cm::ctrla::MODESELECT_A,
6-
sercom::*,
6+
sercom::{Sercom, APB_CLK_CTRL},
77
time::Hertz,
88
typelevel::{Is, Sealed},
99
};

hal/src/sercom/i2c/flags.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ pub enum BusState {
3030
Busy = 0x03,
3131
}
3232

33+
impl Default for Status {
34+
fn default() -> Self {
35+
Self::new()
36+
}
37+
}
38+
3339
/// Status flags for I2C transactions
3440
///
3541
/// The available status flags are `BUSERR`, `ARBLOST`, `RXNACK`,

hal/src/sercom/i2c/reg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::flags::{BusState, Error};
44
use super::InactiveTimeout;
55
use super::{Flags, Status};
66
use crate::pac;
7-
use crate::sercom::*;
7+
use crate::sercom::Sercom;
88
use crate::time::Hertz;
99

1010
const MASTER_ACT_READ: u8 = 2;

hal/src/sercom/spi.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,13 @@ let (chan0, _, spi, _) = dma_transfer.wait();
301301

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

304-
use core::convert::TryFrom;
305304
use core::marker::PhantomData;
306305

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

311-
use crate::sercom::*;
310+
use crate::sercom::{pad::SomePad, Sercom, APB_CLK_CTRL};
312311
use crate::time::Hertz;
313312
use crate::typelevel::{Is, NoneT, Sealed};
314313

hal/src/sercom/spi/reg.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use atsamd_hal_macros::{hal_cfg, hal_macro_helper};
22

3-
use core::convert::TryInto;
4-
53
use embedded_hal::spi;
64

75
#[hal_cfg(any("sercom0-d11", "sercom0-d21"))]

hal/src/sercom/uart.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ pub use config::*;
406406

407407
pub mod impl_ehal;
408408

409-
use crate::{sercom::*, typelevel::Sealed};
410-
use core::{convert::TryInto, marker::PhantomData};
409+
use crate::{sercom::pad::SomePad, typelevel::Sealed};
410+
use core::marker::PhantomData;
411411
use num_traits::AsPrimitive;
412412

413413
/// Size of the SERCOM's `DATA` register

hal/src/sercom/uart/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use super::{
88
};
99
use crate::{
1010
pac,
11-
sercom::*,
11+
sercom::Sercom,
1212
time::Hertz,
1313
typelevel::{Is, Sealed},
1414
};

hal/src/sercom/uart/flags.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Flag definitions
22
33
use bitflags::bitflags;
4-
use core::convert::TryFrom;
54

65
//=============================================================================
76
// Interrupt flags

hal/src/sercom/uart/reg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use atsamd_hal_macros::hal_cfg;
55
use super::{BaudMode, BitOrder, CharSizeEnum, Flags, Oversampling, Parity, Status, StopBits};
66

77
use crate::pac;
8-
use crate::sercom::*;
8+
use crate::sercom::Sercom;
99

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

0 commit comments

Comments
 (0)