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;
while (true) {
/* If the INT_N line is low */
if (!notifSent) {
if (xTaskNotifyWait(0x00, 0x0F, NULL, 25) == pdPASS) {
osDelay(1);
}
if (xTaskNotifyWait(0x00, 0x0F, NULL, 200) == pdPASS) {
//delay slightly so we catch the crc with better timing
osDelay(2);
}
notifSent = false;
/* 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
* thread */
if (notifSent == false) {
events = 0;
if (status.interrupta & FUSB_INTERRUPTA_I_HARDRST) {
events |= PDB_EVT_HARDRST_I_HARDRST;
@@ -87,6 +87,7 @@ void InterruptHandler::Thread(const void *arg) {
if (events) {
ResetHandler::notify(events);
}
}
/* If the I_OCP_TEMP and OVRTEMP flags are set, tell the Policy
* Engine thread */
if (status.interrupta & FUSB_INTERRUPTA_I_OCP_TEMP