Skip to content

Commit 6411ac4

Browse files
stickbreakerme-no-dev
authored andcommitted
Remove confusing Debug output. (#1574)
If Core Debug Level is at DEBUG, a confusing debug message will be emitted if the I2C transaction takes longer complete than the calculated minimum time. This original debug message was just to prove that this new i2c code could correctly handle SCL stretching or interrupt latency issues. This delay is not a problem, or an error. Usually it is caused by a higher priory interrupt starving the i2c ISR. Usually WiFi is the culprit. As long of this delay is within the configured timeout (by default 50ms, or can be set with Wire.setTimeOut(milliseconds);) no problem will occur and the transaction will successfully complete. Chuck.
1 parent 184bb06 commit 6411ac4

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

cores/esp32/esp32-hal-i2c.c

-9
Original file line numberDiff line numberDiff line change
@@ -990,15 +990,6 @@ i2c_err_t i2cProcQueue(i2c_t * i2c, uint32_t *readCount, uint16_t timeOutMillis)
990990
}
991991

992992
if(eBits&EVENT_DONE) { // no gross timeout
993-
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
994-
uint32_t expected =(totalBytes*10*1000)/i2cGetFrequency(i2c);
995-
if((tAfter-tBefore)>(expected+1)) { //used some of the timeout Period
996-
// expected can be zero due to small packets
997-
log_e("TimeoutRecovery: expected=%ums, actual=%ums",expected,(tAfter-tBefore));
998-
i2cDumpI2c(i2c);
999-
i2cDumpInts(i2c->num);
1000-
}
1001-
#endif
1002993
switch(i2c->error) {
1003994
case I2C_OK :
1004995
reason = I2C_ERROR_OK;

0 commit comments

Comments
 (0)