Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7392f85

Browse filesBrowse files
committed
Fix to drop packets in Wire library (issue arduino#335).
1 parent ea8a118 commit 7392f85
Copy full SHA for 7392f85

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Filter options
  • libraries/Wire/utility
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed

‎libraries/Wire/utility/twi.c

Copy file name to clipboardExpand all lines: libraries/Wire/utility/twi.c
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,14 @@ SIGNAL(TWI_vect)
413413
if(twi_rxBufferIndex < TWI_BUFFER_LENGTH){
414414
twi_rxBuffer[twi_rxBufferIndex] = '\0';
415415
}
416+
// sends ack and stops interface for clock stretching
417+
twi_stop();
416418
// callback to user defined callback
417419
twi_onSlaveReceive(twi_rxBuffer, twi_rxBufferIndex);
418-
// ack future responses
419-
twi_reply(1);
420-
// leave slave receiver state
421-
twi_state = TWI_READY;
420+
// since we submit rx buffer to "wire" library, we can reset it
421+
twi_rxBufferIndex = 0;
422+
// ack future responses and leave slave receiver state
423+
twi_releaseBus();
422424
break;
423425
case TW_SR_DATA_NACK: // data received, returned nack
424426
case TW_SR_GCALL_DATA_NACK: // data received generally, returned nack

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.