AzureMXChip/MXCHIPAZ3166/core/lib/threadx/ports_module/cortex_a35/gnu/example_build/sample_threadx_module_manager/timer_interrupts.c
void fiqHandler(void)
{
  unsigned int ID;
  unsigned int aliased = 0;

  ID = getICC_IAR0(); // readIntAck();
  //printf("fiqHandler() - Read %d from IAR0\n", ID);

  // Check for reserved IDs
  if ((1020 <= ID) && (ID <= 1023))
  {
    //printf("fiqHandler() - Reserved INTID %d\n\n", ID);
    ID = getICC_IAR1(); // readAliasedIntAck();
    //printf("fiqHandler() - Read %d from AIAR\n", ID);
    aliased = 1;

    // If still spurious then simply return
    if ((1020 <= ID) && (ID <= 1023))
        return;
  }

  switch(ID)
  {
    case 34:
      // Dual-Timer 0 (SP804)
      //printf("fiqHandler() - External timer interrupt\n\n");
      clearTimerIrq();
      break;

    default:
      // Unexpected ID value
      //printf("fiqHandler() - Unexpected INTID %d\n\n", ID);
      break;
  }

  // Write the End of Interrupt register to tell the GIC
  // we've finished handling the interrupt
  // NOTE: If the ID was read from the Aliased IAR, then
  // the aliased EOI register must be used
  if (aliased == 0)
    setICC_EOIR0(ID); // writeEOI(ID);
  else
    setICC_EOIR1(ID); // writeAliasedEOI(ID);
}
// Not actually used in this example, but provided for completeness
Not actually used in this example, but provided for completeness
Not actually used in this example but provided for completeness
void fiqHandler(void)
{
  unsigned int ID;
  unsigned int aliased = 0;
  ID = getICC_IAR0(); 
  if ((1020 <= ID) && (ID <= 1023))
  {
    ID = getICC_IAR1(); 
    aliased = 1;
    if ((1020 <= ID) && (ID <= 1023))
        return;
  }
  switch(ID)
  {
    case 34:
      clearTimerIrq();
      break;
    default:
      break;
  }
  if (aliased == 0)
    setICC_EOIR0(ID); 
  else
    setICC_EOIR1(ID); 
}
void fiqHandler ( void ) { unsigned int ID ; unsigned int aliased = 0 ; ID = getICC_IAR0 ( ) ; if ( ( 1020 <= ID ) && ( ID <= 1023 ) ) { ID = getICC_IAR1 ( ) ; aliased = 1 ; if ( ( 1020 <= ID ) && ( ID <= 1023 ) ) return ; } switch ( ID ) { case 34 : clearTimerIrq ( ) ; break ; default : break ; } if ( aliased == 0 ) setICC_EOIR0 ( ID ) ; else setICC_EOIR1 ( ID ) ; }
Not actually used in this example, but provided for completeness
Not actually used in this example but provided for completeness
// readIntAck(); //printf("fiqHandler() - Read %d from IAR0\n", ID); // Check for reserved IDs //printf("fiqHandler() - Reserved INTID %d\n\n", ID); // readAliasedIntAck(); //printf("fiqHandler() - Read %d from AIAR\n", ID); // If still spurious then simply return // Dual-Timer 0 (SP804) //printf("fiqHandler() - External timer interrupt\n\n"); // Unexpected ID value //printf("fiqHandler() - Unexpected INTID %d\n\n", ID); // Write the End of Interrupt register to tell the GIC // we've finished handling the interrupt // NOTE: If the ID was read from the Aliased IAR, then // the aliased EOI register must be used // writeEOI(ID); // writeAliasedEOI(ID);