utzig commented on a change in pull request #2331:
URL: https://github.com/apache/mynewt-core/pull/2331#discussion_r454623080



##########
File path: hw/mcu/stm/stm32_common/src/stm32_driver_mod_i2c_v1.c
##########
@@ -695,14 +695,14 @@ HAL_StatusTypeDef 
HAL_I2C_Master_Receive_Custom(I2C_HandleTypeDef *hi2c,
     }
     else if(hi2c->XferSize == 2U)
     {
-      /* Disable Acknowledge */
-      hi2c->Instance->CR1 &= ~I2C_CR1_ACK;
-
       /* Enable Pos */
       hi2c->Instance->CR1 |= I2C_CR1_POS;
 
       /* Clear ADDR flag */
       __HAL_I2C_CLEAR_ADDRFLAG(hi2c);
+
+      /* Disable Acknowledge */
+      hi2c->Instance->CR1 &= ~I2C_CR1_ACK;

Review comment:
       This driver is shared between F1/L1/F4, and for L1/F4 the order of 
operations would best remain unchanged, so maybe add some `#if 
MYNEWT_VAL(MCU_STM32F1)` here?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to