Merge pull request #6606 from maximmbed/max32630-fix-i2c

Fix I2C master
pull/6648/head
Cruz Monrreal 2018-04-16 10:38:10 -05:00 committed by GitHub
commit b630691fdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 6 deletions

View File

@ -100,7 +100,6 @@ int i2c_stop(i2c_t *obj)
//****************************************************************************** //******************************************************************************
int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) int i2c_read(i2c_t *obj, int address, char *data, int length, int stop)
{ {
MBED_ASSERT(stop != 0);
return I2CM_Read(obj->i2c, address >> 1, NULL, 0, (uint8_t *)data, length); return I2CM_Read(obj->i2c, address >> 1, NULL, 0, (uint8_t *)data, length);
} }
@ -146,11 +145,6 @@ int i2c_byte_read(i2c_t *obj, int last)
if (I2CM_WriteTxFifo(i2cm, fifo, MXC_S_I2CM_TRANS_TAG_RXDATA_NACK) != E_NO_ERROR) { if (I2CM_WriteTxFifo(i2cm, fifo, MXC_S_I2CM_TRANS_TAG_RXDATA_NACK) != E_NO_ERROR) {
goto byte_read_err; goto byte_read_err;
} }
// Send the stop condition
if (I2CM_WriteTxFifo(i2cm, fifo, MXC_S_I2CM_TRANS_TAG_STOP) != E_NO_ERROR) {
goto byte_read_err;
}
} else { } else {
if (I2CM_WriteTxFifo(i2cm, fifo, MXC_S_I2CM_TRANS_TAG_RXDATA_COUNT) != E_NO_ERROR) { if (I2CM_WriteTxFifo(i2cm, fifo, MXC_S_I2CM_TRANS_TAG_RXDATA_COUNT) != E_NO_ERROR) {
goto byte_read_err; goto byte_read_err;