diff options
| author | Hierophect <hierophect@gmail.com> | 2019-10-02 17:59:42 -0400 |
|---|---|---|
| committer | Hierophect <hierophect@gmail.com> | 2019-10-02 17:59:42 -0400 |
| commit | 5a6194839bebb356074fcc9f03a1107a6abdaa22 (patch) | |
| tree | 6cd02fc3c95aa81a8eea5b0bca378301557ee213 | |
| parent | 86305bfdfece1d2fc89a7f65385133c84b8f500c (diff) | |
Timeout fix for I2C device testing
| -rw-r--r-- | ports/stm32f4/common-hal/busio/I2C.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/stm32f4/common-hal/busio/I2C.c b/ports/stm32f4/common-hal/busio/I2C.c index 8af670394..c2f5dbe0a 100644 --- a/ports/stm32f4/common-hal/busio/I2C.c +++ b/ports/stm32f4/common-hal/busio/I2C.c @@ -221,11 +221,11 @@ void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, const uint8_t *data, size_t len, bool transmit_stop_bit) { - HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr<<1), (uint8_t *)data, (uint16_t)len, 2); + HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr<<1), (uint8_t *)data, (uint16_t)len, 500); return result == HAL_OK ? 0 : MP_EIO; } uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, uint8_t *data, size_t len) { - return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 2) == HAL_OK ? 0 : MP_EIO; + return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500) == HAL_OK ? 0 : MP_EIO; } |
