From fac2dfd712d82cbf047468aa1091b1503624f6f4 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Mon, 5 Apr 2021 11:57:44 +1000 Subject: [PATCH] Update policy_engine.cpp --- source/Core/Drivers/FUSB302/policy_engine.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/Core/Drivers/FUSB302/policy_engine.cpp b/source/Core/Drivers/FUSB302/policy_engine.cpp index 6dce1299..84914240 100644 --- a/source/Core/Drivers/FUSB302/policy_engine.cpp +++ b/source/Core/Drivers/FUSB302/policy_engine.cpp @@ -407,8 +407,8 @@ PolicyEngine::policy_engine_state PolicyEngine::pe_sink_ready() { return PESinkSendSoftReset; } } else { - /* if we get an unknown message code, silently ignore it*/ - return PESinkReady; + /* if we get an unknown message code, reset*/ + return PESinkSendSoftReset; } } } @@ -630,7 +630,9 @@ bool PolicyEngine::isPD3_0() { return (hdr_template & PD_HDR_SPECREV) == PD_SPEC void PolicyEngine::PPSTimerCallback() { if (PPSTimerEnabled) { - if (xTaskGetTickCount() - PPSTimeLastEvent > TICKS_100MS) { + // I believe even once per second is totally fine, but leaning on faster since everything seems cool with faster + // Have seen everything from 10ms to 1 second :D + if (xTaskGetTickCount() - PPSTimeLastEvent > 3 * TICKS_100MS) { // Send a new PPS message PPSTimeLastEvent = xTaskGetTickCount(); notify(PDB_EVT_PE_PPS_REQUEST);