You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This work includes some rework of the Slave RX path, which is based on
below principle:
- we don't know in advance how many bytes will be sent by the I2C master
so we'll be listening to bytes 1 by 1
- in order to get them one by one, we're programing the I2C with
HAL_I2C_Slave_Sequential_Receive_IT and 1 byte at a time and we're using
the HAL_I2C_SlaveRxCpltCallback to store the byte then programing again
for next byte.
- this sequence is ended when the HAL_I2C_ListenCpltCallback is called,
which happens when the master ends the ongoing sequence. We can then
prepare for the next one.
In order to implement this mecanism, we're introduced a local counter
slaveRxNbData where we store the number of received bytes, as well as a
new slave mode SLAVE_MODE_LISTEN which allows for extra checks.
i2c_s structure members that can be modified from main context or under
interrupt context have been marked as volatile.
0 commit comments