@@ -3492,6 +3492,29 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16
3492
3492
while (__HAL_I2C_GET_FLAG (hi2c , I2C_FLAG_BUSY ) != RESET );
3493
3493
}
3494
3494
3495
+ /*+ Fix_Candidate_Ticket_79517_V1 */
3496
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */
3497
+ /* Wait until STOP flag is reset */
3498
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U );
3499
+ do
3500
+ {
3501
+ count -- ;
3502
+ if (count == 0U )
3503
+ {
3504
+ hi2c -> PreviousState = I2C_STATE_NONE ;
3505
+ hi2c -> State = HAL_I2C_STATE_READY ;
3506
+ hi2c -> Mode = HAL_I2C_MODE_NONE ;
3507
+ hi2c -> ErrorCode |= HAL_I2C_ERROR_TIMEOUT ;
3508
+
3509
+ /* Process Unlocked */
3510
+ __HAL_UNLOCK (hi2c );
3511
+
3512
+ return HAL_ERROR ;
3513
+ }
3514
+ }
3515
+ while (READ_BIT (hi2c -> Instance -> CR1 , I2C_CR1_STOP ) == I2C_CR1_STOP );
3516
+ /*- Fix_Candidate_Ticket_79517_V1 */
3517
+
3495
3518
/* Process Locked */
3496
3519
__HAL_LOCK (hi2c );
3497
3520
@@ -3591,6 +3614,29 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint1
3591
3614
while (__HAL_I2C_GET_FLAG (hi2c , I2C_FLAG_BUSY ) != RESET );
3592
3615
}
3593
3616
3617
+ /*+ Fix_Candidate_Ticket_79517_V1 */
3618
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */
3619
+ /* Wait until STOP flag is reset */
3620
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U );
3621
+ do
3622
+ {
3623
+ count -- ;
3624
+ if (count == 0U )
3625
+ {
3626
+ hi2c -> PreviousState = I2C_STATE_NONE ;
3627
+ hi2c -> State = HAL_I2C_STATE_READY ;
3628
+ hi2c -> Mode = HAL_I2C_MODE_NONE ;
3629
+ hi2c -> ErrorCode |= HAL_I2C_ERROR_TIMEOUT ;
3630
+
3631
+ /* Process Unlocked */
3632
+ __HAL_UNLOCK (hi2c );
3633
+
3634
+ return HAL_ERROR ;
3635
+ }
3636
+ }
3637
+ while (READ_BIT (hi2c -> Instance -> CR1 , I2C_CR1_STOP ) == I2C_CR1_STOP );
3638
+ /*- Fix_Candidate_Ticket_79517_V1 */
3639
+
3594
3640
/* Process Locked */
3595
3641
__HAL_LOCK (hi2c );
3596
3642
@@ -3757,6 +3803,29 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_
3757
3803
while (__HAL_I2C_GET_FLAG (hi2c , I2C_FLAG_BUSY ) != RESET );
3758
3804
}
3759
3805
3806
+ /*+ Fix_Candidate_Ticket_79517_V1 */
3807
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */
3808
+ /* Wait until STOP flag is reset */
3809
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U );
3810
+ do
3811
+ {
3812
+ count -- ;
3813
+ if (count == 0U )
3814
+ {
3815
+ hi2c -> PreviousState = I2C_STATE_NONE ;
3816
+ hi2c -> State = HAL_I2C_STATE_READY ;
3817
+ hi2c -> Mode = HAL_I2C_MODE_NONE ;
3818
+ hi2c -> ErrorCode |= HAL_I2C_ERROR_TIMEOUT ;
3819
+
3820
+ /* Process Unlocked */
3821
+ __HAL_UNLOCK (hi2c );
3822
+
3823
+ return HAL_ERROR ;
3824
+ }
3825
+ }
3826
+ while (READ_BIT (hi2c -> Instance -> CR1 , I2C_CR1_STOP ) == I2C_CR1_STOP );
3827
+ /*- Fix_Candidate_Ticket_79517_V1 */
3828
+
3760
3829
/* Process Locked */
3761
3830
__HAL_LOCK (hi2c );
3762
3831
@@ -3882,6 +3951,29 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16
3882
3951
while (__HAL_I2C_GET_FLAG (hi2c , I2C_FLAG_BUSY ) != RESET );
3883
3952
}
3884
3953
3954
+ /*+ Fix_Candidate_Ticket_79517_V1 */
3955
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */
3956
+ /* Wait until STOP flag is reset */
3957
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U );
3958
+ do
3959
+ {
3960
+ count -- ;
3961
+ if (count == 0U )
3962
+ {
3963
+ hi2c -> PreviousState = I2C_STATE_NONE ;
3964
+ hi2c -> State = HAL_I2C_STATE_READY ;
3965
+ hi2c -> Mode = HAL_I2C_MODE_NONE ;
3966
+ hi2c -> ErrorCode |= HAL_I2C_ERROR_TIMEOUT ;
3967
+
3968
+ /* Process Unlocked */
3969
+ __HAL_UNLOCK (hi2c );
3970
+
3971
+ return HAL_ERROR ;
3972
+ }
3973
+ }
3974
+ while (READ_BIT (hi2c -> Instance -> CR1 , I2C_CR1_STOP ) == I2C_CR1_STOP );
3975
+ /*- Fix_Candidate_Ticket_79517_V1 */
3976
+
3885
3977
/* Process Locked */
3886
3978
__HAL_LOCK (hi2c );
3887
3979
0 commit comments