safeguards added to logger I2C so it does not sleep before memory is written