1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-15 12:29:26 +01:00

Merge branch 'sam-wire-repeated-starts' of https://github.com/sandeepmistry/Arduino

This commit is contained in:
Cristian Maglie 2015-10-29 21:18:11 +01:00
commit d3e3b8b377

View File

@ -332,8 +332,7 @@ void TwoWire::onService(void) {
} }
} }
if (status != SLAVE_IDLE) { if (status != SLAVE_IDLE && TWI_STATUS_EOSACC(sr)) {
if (TWI_STATUS_TXCOMP(sr) && TWI_STATUS_EOSACC(sr)) {
if (status == SLAVE_RECV && onReceiveCallback) { if (status == SLAVE_RECV && onReceiveCallback) {
// Copy data into rxBuffer // Copy data into rxBuffer
// (allows to receive another packet while the // (allows to receive another packet while the
@ -353,7 +352,6 @@ void TwoWire::onService(void) {
| TWI_IDR_EOSACC | TWI_IDR_SCL_WS | TWI_IER_TXCOMP); | TWI_IDR_EOSACC | TWI_IDR_SCL_WS | TWI_IER_TXCOMP);
status = SLAVE_IDLE; status = SLAVE_IDLE;
} }
}
if (status == SLAVE_RECV) { if (status == SLAVE_RECV) {
if (TWI_STATUS_RXRDY(sr)) { if (TWI_STATUS_RXRDY(sr)) {