Skip to content

Commit 3c526cb

Browse files
committed
Fix MSBs calculation
1 parent a181da1 commit 3c526cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/i2c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ impl<I2C: Instance> I2c<I2C> {
348348
}
349349
Address::Ten(addr) => {
350350
let [msbs, lsbs] = addr.to_be_bytes();
351-
let msbs = ((msbs & 0b11) << 1) & 0b11110000;
351+
let msbs = ((msbs & 0b11) << 1) | 0b11110000;
352352
let dr = self.i2c.dr();
353353
if first_transaction {
354354
dr.write(|w| unsafe { w.bits(u32::from(msbs)) });

0 commit comments

Comments
 (0)