In the file "FABlin/Marlin/Marlin_main.cpp", in the function "I2C_read()" there is a timeout with millis() after the Wire.requestFrom(). However, there is nothing to wait for.
Explanation: Common-mistakes#1
Since the return value of Wire.endTransmission() is not tested, the test for Wire.requestFrom() could perhaps be omitted as well:
Wire.requestFrom(SERIAL_ID_ADDR, 1); // request 1 bytes from slave device SERIAL_ID_ADDR
return( (char) Wire.read()); // return a byte as character
}
When the Wire.requestFrom() needs a check for a valid I2C transaction, it could be like this:
Wire.requestFrom(SERIAL_ID_ADDR, 1); // request 1 bytes from slave device SERIAL_ID_ADDR
if(Wire.available() != 1) // request for 1 bytes failed ?
{
return('?'); // return a byte as character
}
else
{
return( (char) Wire.read()); // return a byte as character
}
}