From f0eb04fb699615d83fac3ead610cade7608d9b9e Mon Sep 17 00:00:00 2001 From: Jasper Horn Date: Sat, 23 Dec 2017 14:53:31 +0100 Subject: [PATCH] Execute request call for each byte requested This reverses the change done in a503849. That change changed the API (even if it wasn't in a way visible through the methods) and failed to match the way the library was intended to be used. This once again makes it possible to send bodies larger than the buffer. --- TinyWireS/usiTwiSlave.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TinyWireS/usiTwiSlave.c b/TinyWireS/usiTwiSlave.c index ecb0365..a11bfba 100644 --- a/TinyWireS/usiTwiSlave.c +++ b/TinyWireS/usiTwiSlave.c @@ -573,7 +573,6 @@ ISR( USI_OVERFLOW_VECTOR ) { if ( USIDR & 0x01 ) { - USI_REQUEST_CALLBACK(); overflowState = USI_SLAVE_SEND_DATA; } else @@ -591,6 +590,9 @@ ISR( USI_OVERFLOW_VECTOR ) // Master write data mode: check reply and goto USI_SLAVE_SEND_DATA if OK, // else reset USI case USI_SLAVE_CHECK_REPLY_FROM_SEND_DATA: + // Execute request callback for each byte requested, as this is the intended + // behavior of this library + USI_REQUEST_CALLBACK(); if ( USIDR ) { // if NACK, the master does not want more data