-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
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.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -573,7 +573,6 @@ ISR( USI_OVERFLOW_VECTOR ) | |
{ | ||
if ( USIDR & 0x01 ) | ||
{ | ||
USI_REQUEST_CALLBACK(); | ||
overflowState = USI_SLAVE_SEND_DATA; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
} | ||
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(); | ||
This comment has been minimized.
Sorry, something went wrong.
bmbeyers
|
||
if ( USIDR ) | ||
{ | ||
// if NACK, the master does not want more data | ||
|
2 comments
on commit f0eb04f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though it fixes an issue, ##36, but, take a look at last @dersimn comment, f0eb04f commit broke simplest case with non-i2c-hardware supported devices. I have wemos d1 (esp8266) talking to attiny85. All esp8266 does: reads 1 byte from attiny85, requestEvent method on attiny85 is never getting called and from the code & saleae logs I can see it always returns 255, NACK (can provide SALEAE data if needed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added comments about where to move USI_REQUEST_CALLBACK() function to get the appropriate, expected behavior.
Here we keep the overflowState listed as USI_SLAVE_SEND_DATA, yet USI_REQUEST_CALLBACK() function was moved to USI_SLAVE_CHECK_REPLY_FROM_SEND_DATA case...