In #271 the sda_low function was changed to use a tsb instruction instead of an ora/sta pair. It is possible for i2c_write to branch to rec_bit and then fall through to sda_low which can ultimately cause i2c_write to return with the Z flag set using different semantics than expected.
This issue is causing i2c_write_byte to branch to its error exit point when no error has occurred. This is the root cause of failures to set the time on the real-time clock on r40 and r41.
In #271 the
sda_low
function was changed to use atsb
instruction instead of anora
/sta
pair. It is possible fori2c_write
to branch torec_bit
and then fall through tosda_low
which can ultimately causei2c_write
to return with the Z flag set using different semantics than expected.This issue is causing
i2c_write_byte
to branch to its error exit point when no error has occurred. This is the root cause of failures to set the time on the real-time clock on r40 and r41.