Skip to content

STM32: Remove i2c_read() and i2c_write() redirects to HAL_I2C_IsDeviceReady() #4717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions targets/TARGET_STM/i2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,13 +743,6 @@ int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) {
int count = I2C_ERROR_BUS_BUSY, ret = 0;
uint32_t timeout = 0;

if((length == 0) || (data == 0)) {
if(HAL_I2C_IsDeviceReady(handle, address, 1, 10) == HAL_OK)
return 0;
else
return I2C_ERROR_BUS_BUSY;
}

if ((obj_s->XferOperation == I2C_FIRST_AND_LAST_FRAME) ||
(obj_s->XferOperation == I2C_LAST_FRAME)) {
if (stop)
Expand Down Expand Up @@ -802,13 +795,6 @@ int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop) {
int count = I2C_ERROR_BUS_BUSY, ret = 0;
uint32_t timeout = 0;

if((length == 0) || (data == 0)) {
if(HAL_I2C_IsDeviceReady(handle, address, 1, 10) == HAL_OK)
return 0;
else
return I2C_ERROR_BUS_BUSY;
}

if ((obj_s->XferOperation == I2C_FIRST_AND_LAST_FRAME) ||
(obj_s->XferOperation == I2C_LAST_FRAME)) {
if (stop)
Expand Down