AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/twi/twim.c
static inline status_code_t twim_release(void)
{
    /* First wait for the driver event handler to indicate something
     * other than a transfer in-progress, then test the bus interface
     * for an Idle bus state.
     */
    while (OPERATION_IN_PROGRESS == transfer.status);

    while (!twim_idle(transfer.bus)) {
        barrier();
    }

    status_code_t const status = transfer.status;

    transfer.locked = false;

    return status;
}
/**
 * \internal
 *
 * \brief Release exclusive access to global TWI resources.
 *
 * Release bus hardware interface and ISR variables previously locked by
 * a call to \ref twim_acquire().  This function will busy-wait for
 * pending driver operations to complete.
 *
 * \return  status_code_t
 *      - STATUS_OK if the transfer completes
 *      - ERR_BUSY to indicate an unavailable bus
 *      - ERR_IO_ERROR to indicate a bus transaction error
 *      - ERR_NO_MEMORY to indicate buffer errors
 *      - ERR_PROTOCOL to indicate an unexpected bus state
 */
\internal
\brief Release exclusive access to global TWI resources.

Release bus hardware interface and ISR variables previously locked by
a call to \ref twim_acquire().  This function will busy-wait for
pending driver operations to complete.


\ internal \ brief Release exclusive access to global TWI resources . Release bus hardware interface and ISR variables previously locked by a call to \ ref twim_acquire () . This function will busy - wait for pending driver operations to complete .
static inline status_code_t twim_release(void)
{
    while (OPERATION_IN_PROGRESS == transfer.status);
    while (!twim_idle(transfer.bus)) {
        barrier();
    }
    status_code_t const status = transfer.status;
    transfer.locked = false;
    return status;
}
static inline status_code_t twim_release ( void ) { while ( OPERATION_IN_PROGRESS == transfer . status ) ; while ( ! twim_idle ( transfer . bus ) ) { barrier ( ) ; } status_code_t const status = transfer . status ; transfer . locked = false ; return status ; }
\internal
 \brief Release exclusive access to global TWI resources.
\ internal \ brief Release exclusive access to global TWI resources .
/* First wait for the driver event handler to indicate something
     * other than a transfer in-progress, then test the bus interface
     * for an Idle bus state.
     */