We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6e2796e + 7f487b3 commit 231b9d3Copy full SHA for 231b9d3
STM32F1/cores/maple/libmaple/i2c.c
@@ -175,8 +175,8 @@ void i2c_init(i2c_dev *dev) {
175
* SDA/PB9.
176
*/
177
void i2c_master_enable(i2c_dev *dev, uint32 flags) {
178
- /* PE must be disabled to configure the device */
179
- ASSERT(!(dev->regs->CR1 & I2C_CR1_PE));
+ /* If the device is already enabled, don't do it again */
+ if(dev->regs->CR1 & I2C_CR1_PE) return;
180
181
/* Ugh */
182
_i2c_handle_remap(dev, flags);
0 commit comments