Skip to content

Commit 9ada869

Browse files
committed
More cleanup
1 parent cf32715 commit 9ada869

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/i2c.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ enum Direction {
9090

9191
/// Addressing mode
9292
#[derive(Copy, Clone, PartialEq, Eq)]
93-
pub enum AddressMode {
93+
enum AddressMode {
9494
/// 7-bit addressing mode
9595
AddressMode7bit,
9696
/// 10-bit addressing mode
@@ -108,9 +108,6 @@ pub enum Error {
108108
Arbitration,
109109
/// NACK received
110110
NotAcknowledge,
111-
/// Target operation only: indicates that a stop or repeat start was
112-
/// received while reading
113-
TransferStopped,
114111
}
115112

116113
/// A trait to represent the SCL Pin of an I2C Port
@@ -485,10 +482,6 @@ impl<I2C: Instance> Inner<I2C> {
485482
if isr.rxne().is_not_empty() {
486483
*data = self.i2c.rxdr().read().rxdata().bits();
487484
Ok(true)
488-
} else if isr.stopf().is_stop() || isr.addr().is_match() {
489-
// This is only relevant to Target operation, when the controller stops the read
490-
// operation with a Stop or Restart condition.
491-
Err(Error::TransferStopped)
492485
} else {
493486
Ok(false)
494487
}

src/i2c/hal.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ impl i2c::Error for Error {
1111
Error::NotAcknowledge => {
1212
i2c::ErrorKind::NoAcknowledge(i2c::NoAcknowledgeSource::Unknown)
1313
}
14-
_ => i2c::ErrorKind::Other,
1514
}
1615
}
1716
}

0 commit comments

Comments
 (0)