AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/twi/twis.c
void TWI_SlaveStopHandler(TWI_Slave_t * twi)
{
    /* Disable stop interrupt. */
    uint8_t currentCtrlA = twi->interface->SLAVE.CTRLA;
    twi->interface->SLAVE.CTRLA = currentCtrlA & ~TWI_SLAVE_PIEN_bm;

    /* Clear APIF, according to flowchart don't ACK or NACK */
    uint8_t currentStatus = twi->interface->SLAVE.STATUS;
    twi->interface->SLAVE.STATUS = currentStatus | TWI_SLAVE_APIF_bm;

    TWI_SlaveTransactionFinished(twi, TWIS_RESULT_OK);

}
/*! \brief TWI stop condition interrupt handler.
 *
 *  \param twi The TWI_Slave_t struct instance.
 */
\brief TWI stop condition interrupt handler.
\param twi The TWI_Slave_t struct instance.
\ brief TWI stop condition interrupt handler . \ param twi The TWI_Slave_t struct instance .
void TWI_SlaveStopHandler(TWI_Slave_t * twi)
{
    uint8_t currentCtrlA = twi->interface->SLAVE.CTRLA;
    twi->interface->SLAVE.CTRLA = currentCtrlA & ~TWI_SLAVE_PIEN_bm;
    uint8_t currentStatus = twi->interface->SLAVE.STATUS;
    twi->interface->SLAVE.STATUS = currentStatus | TWI_SLAVE_APIF_bm;
    TWI_SlaveTransactionFinished(twi, TWIS_RESULT_OK);
}
void TWI_SlaveStopHandler ( TWI_Slave_t * twi ) { uint8_t currentCtrlA = twi -> interface -> SLAVE . CTRLA ; twi -> interface -> SLAVE . CTRLA = currentCtrlA & ~ TWI_SLAVE_PIEN_bm ; uint8_t currentStatus = twi -> interface -> SLAVE . STATUS ; twi -> interface -> SLAVE . STATUS = currentStatus | TWI_SLAVE_APIF_bm ; TWI_SlaveTransactionFinished ( twi , TWIS_RESULT_OK ) ; }
\brief TWI stop condition interrupt handler.
\ brief TWI stop condition interrupt handler .
/* Disable stop interrupt. */ /* Clear APIF, according to flowchart don't ACK or NACK */