if (TxLength >0)
{
I2C_SendData(I2C1, *pTxBuffer1++);
TxLength--;
}
/* Disable the I2C_IT_BUF interrupt after sending the last buffer data
(last EV8) to no allow a new interrupt with TxE and only BTF could generate it */
else if(TxLength == 0)
{
I2C_ITConfig(I2C1, I2C_IT_BUF, DISABLE);
I2C_GenerateSTOP(I2C1, ENABLE); }
if (TxLength >0)
{
I2C_SendData(I2C1, *pTxBuffer1++);
TxLength--;
}
/* Disable the I2C_IT_BUF interrupt after sending the last buffer data
(last EV8) to no allow a new interrupt with TxE and only BTF could generate it */
else if(TxLength == 0)
{
I2C_ITConfig(I2C1, I2C_IT_BUF, DISABLE);
I2C_GenerateSTOP(I2C1, ENABLE); }
break;