Skip to content

Commit b6ee1c6

Browse files
dordnungfpistm
authored andcommitted
fix(Wire): only recover bus when device is master
1 parent 1e7007c commit b6ee1c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/Wire/src/Wire.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ void TwoWire::begin(uint8_t address, bool generalCall, bool NoStretchMode)
9090

9191
_i2c.NoStretchMode = (NoStretchMode == true) ? 1 : 0;
9292

93-
recoverBus(); // in case I2C bus (device) is stuck after a reset for example
93+
if (_i2c.isMaster == 1) {
94+
recoverBus(); // in case I2C bus (device) is stuck after a reset for example
95+
}
9496

9597
i2c_init(&_i2c, 100000, ownAddress);
9698

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