From b6ee4207dd90efc9ddf7181c0d3170c04daedcac Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 28 Jul 2020 21:56:50 +1000 Subject: [PATCH] Dont need to soft reset if timing gives SOP' without SOP following Easier to wait again and let timeout handle reset --- .../Core/Drivers/FUSB302/policy_engine.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/workspace/TS100/Core/Drivers/FUSB302/policy_engine.cpp b/workspace/TS100/Core/Drivers/FUSB302/policy_engine.cpp index aa567102..5084f1ea 100644 --- a/workspace/TS100/Core/Drivers/FUSB302/policy_engine.cpp +++ b/workspace/TS100/Core/Drivers/FUSB302/policy_engine.cpp @@ -189,25 +189,20 @@ PolicyEngine::policy_engine_state PolicyEngine::pe_sink_wait_cap() { if ((hdr_template & PD_HDR_SPECREV) == PD_SPECREV_1_0) { /* If the other end is using at least version 3.0, we'll * use version 3.0. */ -// if ((tempMessage.hdr & PD_HDR_SPECREV) >= PD_SPECREV_3_0) { -// hdr_template |= PD_SPECREV_3_0; -// /* Otherwise, use 2.0. Don't worry about the 1.0 case -// * because we don't have hardware for PD 1.0 signaling. */ -// } else { + if ((tempMessage.hdr & PD_HDR_SPECREV) >= PD_SPECREV_3_0) { + hdr_template |= PD_SPECREV_3_0; + /* Otherwise, use 2.0. Don't worry about the 1.0 case + * because we don't have hardware for PD 1.0 signaling. */ + } else { hdr_template |= PD_SPECREV_2_0; -// } + } } return PESinkEvalCap; /* If the message was a Soft_Reset, do the soft reset procedure */ } -// else if (PD_MSGTYPE_GET(&tempMessage) == PD_MSGTYPE_SOFT_RESET -// && PD_NUMOBJ_GET(&tempMessage) == 0) { -// -// return PESinkSoftReset; } -// /* If we got an unexpected message, reset */ evt = 0; } - return PESinkSoftReset; //unknown message == soft reset + return PESinkWaitCap; //unknown message == soft reset }