@@ -3438,6 +3438,29 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16
3438
3438
while (__HAL_I2C_GET_FLAG (hi2c , I2C_FLAG_BUSY ) != RESET );
3439
3439
}
3440
3440
3441
+ /*+ Fix_Candidate_Ticket_79517_V1 */
3442
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */
3443
+ /* Wait until STOP flag is reset */
3444
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U );
3445
+ do
3446
+ {
3447
+ count -- ;
3448
+ if (count == 0U )
3449
+ {
3450
+ hi2c -> PreviousState = I2C_STATE_NONE ;
3451
+ hi2c -> State = HAL_I2C_STATE_READY ;
3452
+ hi2c -> Mode = HAL_I2C_MODE_NONE ;
3453
+ hi2c -> ErrorCode |= HAL_I2C_ERROR_TIMEOUT ;
3454
+
3455
+ /* Process Unlocked */
3456
+ __HAL_UNLOCK (hi2c );
3457
+
3458
+ return HAL_ERROR ;
3459
+ }
3460
+ }
3461
+ while (READ_BIT (hi2c -> Instance -> CR1 , I2C_CR1_STOP ) == I2C_CR1_STOP );
3462
+ /*- Fix_Candidate_Ticket_79517_V1 */
3463
+
3441
3464
/* Process Locked */
3442
3465
__HAL_LOCK (hi2c );
3443
3466
@@ -3537,6 +3560,29 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint1
3537
3560
while (__HAL_I2C_GET_FLAG (hi2c , I2C_FLAG_BUSY ) != RESET );
3538
3561
}
3539
3562
3563
+ /*+ Fix_Candidate_Ticket_79517_V1 */
3564
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */
3565
+ /* Wait until STOP flag is reset */
3566
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U );
3567
+ do
3568
+ {
3569
+ count -- ;
3570
+ if (count == 0U )
3571
+ {
3572
+ hi2c -> PreviousState = I2C_STATE_NONE ;
3573
+ hi2c -> State = HAL_I2C_STATE_READY ;
3574
+ hi2c -> Mode = HAL_I2C_MODE_NONE ;
3575
+ hi2c -> ErrorCode |= HAL_I2C_ERROR_TIMEOUT ;
3576
+
3577
+ /* Process Unlocked */
3578
+ __HAL_UNLOCK (hi2c );
3579
+
3580
+ return HAL_ERROR ;
3581
+ }
3582
+ }
3583
+ while (READ_BIT (hi2c -> Instance -> CR1 , I2C_CR1_STOP ) == I2C_CR1_STOP );
3584
+ /*- Fix_Candidate_Ticket_79517_V1 */
3585
+
3540
3586
/* Process Locked */
3541
3587
__HAL_LOCK (hi2c );
3542
3588
@@ -3703,6 +3749,29 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_
3703
3749
while (__HAL_I2C_GET_FLAG (hi2c , I2C_FLAG_BUSY ) != RESET );
3704
3750
}
3705
3751
3752
+ /*+ Fix_Candidate_Ticket_79517_V1 */
3753
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */
3754
+ /* Wait until STOP flag is reset */
3755
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U );
3756
+ do
3757
+ {
3758
+ count -- ;
3759
+ if (count == 0U )
3760
+ {
3761
+ hi2c -> PreviousState = I2C_STATE_NONE ;
3762
+ hi2c -> State = HAL_I2C_STATE_READY ;
3763
+ hi2c -> Mode = HAL_I2C_MODE_NONE ;
3764
+ hi2c -> ErrorCode |= HAL_I2C_ERROR_TIMEOUT ;
3765
+
3766
+ /* Process Unlocked */
3767
+ __HAL_UNLOCK (hi2c );
3768
+
3769
+ return HAL_ERROR ;
3770
+ }
3771
+ }
3772
+ while (READ_BIT (hi2c -> Instance -> CR1 , I2C_CR1_STOP ) == I2C_CR1_STOP );
3773
+ /*- Fix_Candidate_Ticket_79517_V1 */
3774
+
3706
3775
/* Process Locked */
3707
3776
__HAL_LOCK (hi2c );
3708
3777
@@ -3828,6 +3897,29 @@ HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16
3828
3897
while (__HAL_I2C_GET_FLAG (hi2c , I2C_FLAG_BUSY ) != RESET );
3829
3898
}
3830
3899
3900
+ /*+ Fix_Candidate_Ticket_79517_V1 */
3901
+ /* Before any new treatment like start or restart, check that there is no pending STOP request */
3902
+ /* Wait until STOP flag is reset */
3903
+ count = I2C_TIMEOUT_BUSY_FLAG * (SystemCoreClock / 25U / 1000U );
3904
+ do
3905
+ {
3906
+ count -- ;
3907
+ if (count == 0U )
3908
+ {
3909
+ hi2c -> PreviousState = I2C_STATE_NONE ;
3910
+ hi2c -> State = HAL_I2C_STATE_READY ;
3911
+ hi2c -> Mode = HAL_I2C_MODE_NONE ;
3912
+ hi2c -> ErrorCode |= HAL_I2C_ERROR_TIMEOUT ;
3913
+
3914
+ /* Process Unlocked */
3915
+ __HAL_UNLOCK (hi2c );
3916
+
3917
+ return HAL_ERROR ;
3918
+ }
3919
+ }
3920
+ while (READ_BIT (hi2c -> Instance -> CR1 , I2C_CR1_STOP ) == I2C_CR1_STOP );
3921
+ /*- Fix_Candidate_Ticket_79517_V1 */
3922
+
3831
3923
/* Process Locked */
3832
3924
__HAL_LOCK (hi2c );
3833
3925
0 commit comments