i2c: fix error messages

This commit is contained in:
Sebastien Bourdeauducq 2021-06-25 16:23:50 +08:00
parent 8dbe2cf9f3
commit d18c77c0eb

View File

@ -133,7 +133,7 @@ impl I2c {
return Err("SDA is stuck low and doesn't get unstuck"); return Err("SDA is stuck low and doesn't get unstuck");
} }
if !self.scl_i() { if !self.scl_i() {
return Err("SCL is stuck low and doesn't get unstuck"); return Err("SCL is stuck low");
} }
// postcondition: SCL and SDA high // postcondition: SCL and SDA high
Ok(()) Ok(())
@ -142,7 +142,7 @@ impl I2c {
pub fn start(&mut self) -> Result<(), &'static str> { pub fn start(&mut self) -> Result<(), &'static str> {
// precondition: SCL and SDA high // precondition: SCL and SDA high
if !self.scl_i() { if !self.scl_i() {
return Err("SCL is stuck low and doesn't get unstuck"); return Err("SCL is stuck low");
} }
if !self.sda_i() { if !self.sda_i() {
return Err("SDA arbitration lost"); return Err("SDA arbitration lost");