1
0
forked from me/IronOS

mask stacked reset if another message recieved at the same time

This commit is contained in:
Ben V. Brown
2020-07-28 20:02:32 +10:00
parent c9a8794fb9
commit 8eacf50a5b

View File

@@ -45,10 +45,9 @@ void InterruptHandler::Thread(const void *arg) {
bool notifSent = false; bool notifSent = false;
while (true) { while (true) {
/* If the INT_N line is low */ /* If the INT_N line is low */
if (!notifSent) { if (xTaskNotifyWait(0x00, 0x0F, NULL, 200) == pdPASS) {
if (xTaskNotifyWait(0x00, 0x0F, NULL, 25) == pdPASS) { //delay slightly so we catch the crc with better timing
osDelay(1); osDelay(2);
}
} }
notifSent = false; notifSent = false;
/* Read the FUSB302B status and interrupt registers */ /* Read the FUSB302B status and interrupt registers */
@@ -76,6 +75,7 @@ void InterruptHandler::Thread(const void *arg) {
/* If the I_HARDRST or I_HARDSENT flag is set, tell the Hard Reset /* If the I_HARDRST or I_HARDSENT flag is set, tell the Hard Reset
* thread */ * thread */
if (notifSent == false) {
events = 0; events = 0;
if (status.interrupta & FUSB_INTERRUPTA_I_HARDRST) { if (status.interrupta & FUSB_INTERRUPTA_I_HARDRST) {
events |= PDB_EVT_HARDRST_I_HARDRST; events |= PDB_EVT_HARDRST_I_HARDRST;
@@ -87,6 +87,7 @@ void InterruptHandler::Thread(const void *arg) {
if (events) { if (events) {
ResetHandler::notify(events); ResetHandler::notify(events);
} }
}
/* If the I_OCP_TEMP and OVRTEMP flags are set, tell the Policy /* If the I_OCP_TEMP and OVRTEMP flags are set, tell the Policy
* Engine thread */ * Engine thread */
if (status.interrupta & FUSB_INTERRUPTA_I_OCP_TEMP if (status.interrupta & FUSB_INTERRUPTA_I_OCP_TEMP