Merged in david_s5/nuttx/upstream_kinetis (pull request #414)

Kinetis:I2C fixed mis-placed kinetis_i2c_endwait

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
David Sidrane 2017-06-20 20:22:17 +00:00 committed by Gregory Nutt
commit 345ea957cf

View File

@ -150,6 +150,7 @@ static inline void kinetis_i2c_sem_post(struct kinetis_i2cdev_s *priv);
/* Signal Helper */
static inline void kinetis_i2c_endwait(struct kinetis_i2cdev_s *priv);
static inline void kinetis_i2c_wait(struct kinetis_i2cdev_s *priv);
/* I2C helpers */
@ -368,6 +369,19 @@ static inline void kinetis_i2c_sem_post(struct kinetis_i2cdev_s *priv)
sem_post(&priv->mutex);
}
/************************************************************************************
* Name: kinetis_i2c_wait
*
* Description:
* Wait on the signaling semaphore
*
************************************************************************************/
static inline void kinetis_i2c_wait(struct kinetis_i2cdev_s *priv)
{
sem_wait(&priv->wait);
}
/************************************************************************************
* Name: kinetis_i2c_endwait
*
@ -1160,7 +1174,7 @@ static int kinetis_i2c_transfer(struct i2c_master_s *dev,
wd_start(priv->timeout, I2C_TIMEOUT, kinetis_i2c_timeout, 1,
(uint32_t) priv);
kinetis_i2c_endwait(priv);
kinetis_i2c_wait(priv);
wd_cancel(priv->timeout);