i2c_master: fix wait_stop call
This commit is contained in:
parent
b82520fa9b
commit
c6a4f58b93
@ -158,13 +158,10 @@ try:
|
||||
}
|
||||
|
||||
/** wait until stop is sent and bus is released
|
||||
* @param[in] i2c I²C base address
|
||||
* @return I²C return code
|
||||
*/
|
||||
static enum i2c_master_rc i2c_master_wait_stop(uint32_t i2c)
|
||||
static enum i2c_master_rc i2c_master_wait_stop(void)
|
||||
{
|
||||
cm3_assert(I2C1 == i2c || I2C2 == i2c);
|
||||
|
||||
enum i2c_master_rc to_return = I2C_MASTER_RC_NONE; // return code
|
||||
// prepare timer in case the peripheral hangs on sending stop condition (see errata 2.14.4 Wrong behavior of I²C peripheral in master mode after a misplaced Stop)
|
||||
systick_counter_disable(); // disable SysTick to reconfigure it
|
||||
@ -222,7 +219,7 @@ enum i2c_master_rc i2c_master_stop(void)
|
||||
}
|
||||
|
||||
i2c_send_stop(I2C(I2C_MASTER_I2C)); // send stop to release bus
|
||||
return i2c_master_wait_stop(I2C(I2C_MASTER_I2C));
|
||||
return i2c_master_wait_stop();
|
||||
}
|
||||
|
||||
enum i2c_master_rc i2c_master_select_slave(uint16_t slave, bool address_10bit, bool write)
|
||||
@ -343,7 +340,7 @@ enum i2c_master_rc i2c_master_read(uint8_t* data, size_t data_size)
|
||||
data[i] = i2c_get_data(I2C(I2C_MASTER_I2C)); // read received byte
|
||||
}
|
||||
|
||||
return i2c_master_wait_stop(I2C(I2C_MASTER_I2C));
|
||||
return i2c_master_wait_stop();
|
||||
}
|
||||
|
||||
enum i2c_master_rc i2c_master_write(const uint8_t* data, size_t data_size)
|
||||
|
Loading…
Reference in New Issue
Block a user