diff options
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index ac9e4883e1..4b3272e25e 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -1160,9 +1160,10 @@ static void pe_src_send_capabilities_run(int port) * 3) And the HardResetCounter > nHardResetCount. */ if (pe[port].no_response_timer > 0 && - get_time().val > pe[port].no_response_timer && - pe[port].hard_reset_counter > N_HARD_RESET_COUNT) { - if (PE_CHK_FLAG(port, PE_FLAGS_PD_CONNECTION)) + get_time().val > pe[port].no_response_timer) { + if (pe[port].hard_reset_counter <= N_HARD_RESET_COUNT) + set_state_pe(port, PE_SRC_HARD_RESET); + else if (PE_CHK_FLAG(port, PE_FLAGS_PD_CONNECTION)) set_state_pe(port, PE_WAIT_FOR_ERROR_RECOVERY); else set_state_pe(port, PE_SRC_DISABLED); |