arch/arm/src/sam34/sam_twi.c
/*******************************************************************************
 * Name: twi_wait
 *
 * Description:
 *   Perform a I2C transfer start
 *
 * Assumptions:
 *   Interrupts are disabled
 *
 *******************************************************************************/
twi_wait
Description:
Perform a I2C transfer start

Interrupts are disabled
twi_wait Description : Perform a I2C transfer start Interrupts are disabled
static int twi_wait(struct twi_dev_s *priv)
{
  wd_start(priv->timeout, TWI_TIMEOUT, twi_timeout, 1, (uint32_t)priv);
  do
    {
      i2clldbg("TWI%d Waiting...\n", priv->twi);
      twi_takesem(&priv->waitsem);
      i2clldbg("TWI%d Awakened with result: %d\n", priv->twi, priv->result);
    }
  while (priv->result == -EBUSY);
  return priv->result;
}
static int twi_wait ( struct twi_dev_s * priv ) { wd_start ( priv -> timeout , TWI_TIMEOUT , twi_timeout , 1 , ( uint32_t ) priv ) ; do { i2clldbg ( " \n " , priv -> twi ) ; twi_takesem ( & priv -> waitsem ) ; i2clldbg ( " \n " , priv -> twi , priv -> result ) ; } while ( priv -> result == - EBUSY ) ; return priv -> result ; }
Name: twi_wait
 Description:
   Perform a I2C transfer start
Name : twi_wait Description : Perform a I2C transfer start
/* Start a timeout to avoid hangs */ /* Wait for either the TWI transfer or the timeout to complete */ /* We get here via twi_wakeup.  The watchdog timer has been disabled and
   * all further interrupts for the TWI have been disabled.
   */