changeset 268:f2e52cab0a73

abb_inth.c: check all interrupt causes, not just one The original code used if - else if - else if etc constructs, thus the first detected interrupt was the only one handled. However, Iota ITSTATREG is a clear-on-read register, thus if we only handle the first detected interrupt and skip checking the others, then the other interrupts will be lost, if more than one interrupt happened to occur in one ABB interrupt handling cycle - a form of rare race condition. Change the code to check all interrupts that were read in this cycle.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 13 Jun 2021 18:17:53 +0000
parents 10b3a6876273
children 4f839e1991e8
files src/cs/drivers/drv_app/abb/board/abb_inth.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/abb/board/abb_inth.c	Wed Jun 09 07:26:51 2021 +0000
+++ b/src/cs/drivers/drv_app/abb/board/abb_inth.c	Sun Jun 13 18:17:53 2021 +0000
@@ -159,7 +159,7 @@
       }
    }
 
-   else if (*read_value & REMOT_IT_STS)
+   if (*read_value & REMOT_IT_STS)
    {
       rvf_send_trace("IQ EXT: Power Off remote request",32, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_LOW, SPI_USE_ID);
 
@@ -167,7 +167,7 @@
       Power_OFF_Remote();
    }
 
-   else if (*read_value & ADCEND_IT_STS)
+   if (*read_value & ADCEND_IT_STS)
    {
       rvf_send_trace("IQ EXT: ADC End",15, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_LOW, SPI_USE_ID);
 
@@ -208,7 +208,7 @@
    }
 
 #if (defined(RVM_PWR_SWE) || defined(RVM_LCC_SWE) || defined(RVM_FCHG_SWE))
-   else if (*read_value & CHARGER_IT_STS)
+   if (*read_value & CHARGER_IT_STS)
    {
       /* Charger plug IN or OUT */
 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2))