mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Revision:
153:fa9ff456f731
Parent:
149:156823d33999
Child:
156:95d6b41a828b
--- a/targets/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_hal_i2c.c	Thu Dec 15 11:48:27 2016 +0000
+++ b/targets/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_hal_i2c.c	Tue Dec 20 17:27:56 2016 +0000
@@ -2585,7 +2585,7 @@
     /* Prepare transfer parameters */
     hi2c->pBuffPtr    = pData;
     hi2c->XferCount   = Size;
-    hi2c->XferOptions = XferOptions;
+    hi2c->XferOptions = (XferOptions & (~I2C_RELOAD_MODE));
     hi2c->XferISR     = I2C_Master_ISR_IT;
 
     /* If size > MAX_NBYTE_SIZE, use reload mode */
@@ -2598,15 +2598,7 @@
     {
       hi2c->XferSize = hi2c->XferCount;
       xfermode = hi2c->XferOptions;
-      
-      /* If transfer direction not change, do not generate Restart Condition */
-      /* Mean Previous state is same as current state */
-      if(hi2c->PreviousState == I2C_STATE_SLAVE_BUSY_TX)
-      {
-        xferrequest = I2C_NO_STARTSTOP;
-      }
     }
-    
 
     /* Send Slave Address and set NBYTES to write */
     I2C_TransferConfig(hi2c, DevAddress, hi2c->XferSize, xfermode, xferrequest);
@@ -2659,7 +2651,7 @@
     /* Prepare transfer parameters */
     hi2c->pBuffPtr    = pData;
     hi2c->XferCount   = Size;
-    hi2c->XferOptions = XferOptions;
+    hi2c->XferOptions = (XferOptions & (~I2C_RELOAD_MODE));
     hi2c->XferISR     = I2C_Master_ISR_IT;
 
     /* If hi2c->XferCount > MAX_NBYTE_SIZE, use reload mode */
@@ -2672,13 +2664,6 @@
     {
       hi2c->XferSize = hi2c->XferCount;
       xfermode = hi2c->XferOptions;
-
-      /* If transfer direction not change, do not generate Restart Condition */
-      /* Mean Previous state is same as current state */
-      if(hi2c->PreviousState == I2C_STATE_MASTER_BUSY_RX)
-      {
-        xferrequest = I2C_NO_STARTSTOP;
-      }
     }
 
     /* Send Slave Address and set NBYTES to read */