Skip to content

Commit fb847b9

Browse files
authored
Merge pull request #795 from stm32-rs/i2c-a10-fix
Fix MSBs calculation
2 parents a181da1 + 3c526cb commit fb847b9

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)