Skip to content

Commit 231b9d3

Browse files
Merge branch 'pamribeirox-master'
2 parents 6e2796e + 7f487b3 commit 231b9d3

File tree

1 file changed

+2
-2
lines changed
  • STM32F1/cores/maple/libmaple

1 file changed

+2
-2
lines changed

STM32F1/cores/maple/libmaple/i2c.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ void i2c_init(i2c_dev *dev) {
175175
* SDA/PB9.
176176
*/
177177
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));
178+
/* If the device is already enabled, don't do it again */
179+
if(dev->regs->CR1 & I2C_CR1_PE) return;
180180

181181
/* Ugh */
182182
_i2c_handle_remap(dev, flags);

0 commit comments

Comments
 (0)