1
0
forked from me/IronOS

USB PD timeout added

This commit is contained in:
Varga Zsolt
2021-06-06 18:45:00 +02:00
parent 9ed1c1fc04
commit 81de60e1e4
36 changed files with 252 additions and 0 deletions

View File

@@ -36,6 +36,8 @@ public:
static bool setupCompleteOrTimedOut() {
if (pdNegotiationComplete)
return true;
if (PolicyEngine::NegotiationTimeoutReached())
return true;
if (state == policy_engine_state::PESinkSourceUnresponsive)
return true;
if (state == policy_engine_state::PESinkReady)
@@ -46,11 +48,17 @@ public:
static bool pdHasNegotiated() {
if (state == policy_engine_state::PESinkSourceUnresponsive)
return false;
if (pdNegotiationComplete)
return true;
if (PolicyEngine::NegotiationTimeoutReached())
return false;
return true;
}
// Call this periodically, at least once every second
static void PPSTimerCallback();
static bool NegotiationTimeoutReached();
enum class Notifications {
PDB_EVT_PE_RESET = EVENT_MASK(0),
PDB_EVT_PE_MSG_RX = EVENT_MASK(1),