Merge pull request #1459 from star297/master

Teensy3.1 - K20D50M Update i2c_api.c
pull/1462/head
Martin Kojtal 2015-12-01 09:50:24 +01:00
commit 22ac81f5d7
1 changed files with 1 additions and 7 deletions

View File

@ -85,13 +85,7 @@ int i2c_stop(i2c_t *obj) {
volatile uint32_t n = 0; volatile uint32_t n = 0;
obj->i2c->C1 &= ~I2C_C1_MST_MASK; obj->i2c->C1 &= ~I2C_C1_MST_MASK;
obj->i2c->C1 &= ~I2C_C1_TX_MASK; obj->i2c->C1 &= ~I2C_C1_TX_MASK;
while(obj->i2c->S & I2C_S_BUSY_MASK);
// It seems that there are timing problems
// when there is no waiting time after a STOP.
// This wait is also included on the samples
// code provided with the freedom board
for (n = 0; n < 100; n++)
__NOP();
return 0; return 0;
} }