Skip to content

Commit a38aba7

Browse files
authored
Merge pull request #591 from agprimatic/master
Fix I2C Master hang when communicating with bad I2C slaves.
2 parents 1a7d8d0 + 11dbf85 commit a38aba7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/arduino/SERCOM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,8 @@ bool SERCOM::sendDataMasterWIRE(uint8_t data)
568568
while(!sercom->I2CM.INTFLAG.bit.MB) {
569569

570570
// If a bus error occurs, the MB bit may never be set.
571-
// Check the bus error bit and bail if it's set.
572-
if (sercom->I2CM.STATUS.bit.BUSERR) {
571+
// Check the bus error bit and ARBLOST bit and bail if either is set.
572+
if (sercom->I2CM.STATUS.bit.BUSERR || sercom->I2CM.STATUS.bit.ARBLOST) {
573573
return false;
574574
}
575575
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy