Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominaezzz committed May 23, 2024
1 parent 377885f commit 36ebd2c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ where
self,
data_len: usize,
fifo: Fifo<'d, T, S>,
) -> Result<FifoTransfer<'d, T, M, S>, (Error, Self, Fifo<'d, T, S>)> {
) -> TransferResult<'d, T, M, S> {
if data_len > S::SIZE {
return Err((Error::FifoSizeExeeded, self, fifo));
}
Expand Down Expand Up @@ -1065,7 +1065,7 @@ where
dummy: u8,
data_len: usize,
fifo: Fifo<'d, T, S>,
) -> Result<FifoTransfer<'d, T, M, S>, (Error, Self, Fifo<'d, T, S>)> {
) -> TransferResult<'d, T, M, S> {
if data_len > S::SIZE {
return Err((Error::FifoSizeExeeded, self, fifo));
}
Expand All @@ -1092,7 +1092,7 @@ where
dummy: u8,
data_len: usize,
fifo: Fifo<'d, T, S>,
) -> Result<FifoTransfer<'d, T, M, S>, (Error, Self, Fifo<'d, T, S>)> {
) -> TransferResult<'d, T, M, S> {
if data_len > S::SIZE {
return Err((Error::FifoSizeExeeded, self, fifo));
}
Expand Down Expand Up @@ -1137,6 +1137,9 @@ where
// }
// }

pub type TransferResult<'d, T, M, S> =
Result<FifoTransfer<'d, T, M, S>, (Error, Spi<'d, T, M>, Fifo<'d, T, S>)>;

impl<T> HalfDuplexReadWrite for SpiFifo<'_, T, HalfDuplexMode>
where
T: Instance,
Expand Down Expand Up @@ -3098,6 +3101,7 @@ pub trait Instance: private::Sealed {
reg_block.cmd().modify(|_, w| w.usr().set_bit());
}

#[allow(clippy::too_many_arguments)]
fn init_half_duplex(
&mut self,
is_write: bool,
Expand Down

0 comments on commit 36ebd2c

Please sign in to comment.