Skip to content

Commit 9b70d11

Browse files
2 parents 5c63db7 + ed7560e commit 9b70d11

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

STM32F1/libraries/Wire/Wire.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ void HardWire::setClock(uint32_t frequencyHz)
9797
dev_flags &= ~I2C_FAST_MODE;// clear FAST_MODE bit
9898
break;
9999
}
100-
100+
if (sel_hard->regs->CR1 & I2C_CR1_PE){
101+
i2c_disable(sel_hard);
102+
i2c_master_enable(sel_hard, dev_flags);
103+
}
101104
}
102105

103106
HardWire Wire(1);

0 commit comments

Comments
 (0)