I am currently using the nonblocking I2C slave implementation. I noticed that whenever a repeated start condition was present, I lost data from everything but the last operation.
I believe the reason is because I2cResult::Data is only given by I2c::check_isr_flags when the stop condition interrupt is generated. The problem being that the stop condition interrupt is not generated on a repeated start condition.
Perhaps the solution is to also return I2cResult::Data from the address interrupt if no stop condition happened since the last address was received. The challenge is that I2c::check_isr_flags would then need to return two structs in that call, one for the data and one for the address.
It would be good to hear from those who have more insight into the current implementation.
I am currently using the nonblocking I2C slave implementation. I noticed that whenever a repeated start condition was present, I lost data from everything but the last operation.
I believe the reason is because
I2cResult::Data
is only given byI2c::check_isr_flags
when the stop condition interrupt is generated. The problem being that the stop condition interrupt is not generated on a repeated start condition.Perhaps the solution is to also return
I2cResult::Data
from the address interrupt if no stop condition happened since the last address was received. The challenge is thatI2c::check_isr_flags
would then need to return two structs in that call, one for the data and one for the address.It would be good to hear from those who have more insight into the current implementation.