Skip to content

Commit 2a2e699

Browse files
authored
Remove confusing Debug message
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 0db1b53 commit 2a2e699

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

cores/esp32/esp32-hal-i2c.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,15 +1159,6 @@ if(!(eBits==EVENT_DONE)&&(eBits&~(EVENT_ERROR_NAK|EVENT_ERROR_DATA_NAK|EVENT_ERR
11591159
}
11601160

11611161
if(eBits&EVENT_DONE){ // no gross timeout
1162-
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
1163-
uint32_t expected =(totalBytes*10*1000)/i2cGetFrequency(i2c);
1164-
if((tAfter-tBefore)>(expected+1)) { //used some of the timeout Period
1165-
// expected can be zero due to small packets
1166-
log_d("used TimeoutRecovery: expected=%ums, actual=%ums, configured=%ums ",expected,(tAfter-tBefore),timeOutMillis);
1167-
i2cDumpI2c(i2c);
1168-
i2cDumpInts(i2c->num);
1169-
}
1170-
#endif
11711162
switch(i2c->error){
11721163
case I2C_OK :
11731164
reason = I2C_ERROR_OK;

0 commit comments

Comments
 (0)