We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5d09014 + c1f7128 commit f231655Copy full SHA for f231655
targets/TARGET_STM/i2c_api.c
@@ -627,10 +627,9 @@ int i2c_byte_read(i2c_t *obj, int last) {
627
}
628
629
630
- /* Enable reload mode as we don't know how many bytes will eb sent */
631
- handle->Instance->CR2 |= I2C_CR2_RELOAD;
632
- /* Set transfer size to 1 */
633
- handle->Instance->CR2 |= (I2C_CR2_NBYTES & (1 << 16));
+ /* Enable reload mode as we don't know how many bytes will be sent */
+ /* and set transfer size to 1 */
+ tmpreg |= I2C_CR2_RELOAD | (I2C_CR2_NBYTES & (1 << 16));
634
/* Set the prepared configuration */
635
handle->Instance->CR2 = tmpreg;
636
0 commit comments