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
When NACK is received by master, instead of immediate re-transmission
by twi driver, error is reported. Up to application to manage
re-transmission.
This fix regression found on STM32F2 and STM32F4 when using I2C_OTHER_FRAME.
See PR stm32duino#663
uint32_tXferOptions=obj->handle.XferOptions; // save XferOptions value, because handle can be modified by HAL, which cause issue in case of NACK from slave
745
746
#endif
746
747
747
-
do {
748
748
#if defined(I2C_OTHER_FRAME)
749
-
if (HAL_I2C_Master_Seq_Transmit_IT(&(obj->handle), dev_address, data, size, XferOptions) ==HAL_OK) {
749
+
if (HAL_I2C_Master_Seq_Transmit_IT(&(obj->handle), dev_address, data, size, XferOptions) ==HAL_OK) {
750
750
#else
751
-
if (HAL_I2C_Master_Transmit_IT(&(obj->handle), dev_address, data, size) ==HAL_OK) {
751
+
if (HAL_I2C_Master_Transmit_IT(&(obj->handle), dev_address, data, size) ==HAL_OK) {
752
752
#endif
753
-
ret=I2C_OK;
754
-
// wait for transfer completion
755
-
while ((HAL_I2C_GetState(&(obj->handle)) !=HAL_I2C_STATE_READY)
uint32_tXferOptions=obj->handle.XferOptions; // save XferOptions value, because handle can be modified by HAL, which cause issue in case of NACK from slave
816
816
#endif
817
817
818
-
do {
819
818
#if defined(I2C_OTHER_FRAME)
820
-
if (HAL_I2C_Master_Seq_Receive_IT(&(obj->handle), dev_address, data, size, XferOptions) ==HAL_OK) {
819
+
if (HAL_I2C_Master_Seq_Receive_IT(&(obj->handle), dev_address, data, size, XferOptions) ==HAL_OK) {
821
820
#else
822
-
if (HAL_I2C_Master_Receive_IT(&(obj->handle), dev_address, data, size) ==HAL_OK) {
821
+
if (HAL_I2C_Master_Receive_IT(&(obj->handle), dev_address, data, size) ==HAL_OK) {
823
822
#endif
824
-
ret=I2C_OK;
825
-
// wait for transfer completion
826
-
while ((HAL_I2C_GetState(&(obj->handle)) !=HAL_I2C_STATE_READY)
0 commit comments