//###########################################################################
//
// FILE:    sw_prioritized_defaultisr.c
//
// TITLE:   Default Software Prioritized Interrupt Service Routines.
//
//###########################################################################

//
// NOTE !!!!
// The application must define the ISR routines. The following functions can be
// used a reference.
// Any updates done to this file will be overwritten by the Syscfg tool
//

//
// Interrupts in the order of priority (Highest to Lowest) :
//      - CPU Timer 1 Interrupt (INT13)                  GlobalPriority = 0   GroupPriority = 0
//

#include "sw_prioritized_isr_levels.h"


#ifdef TRACE_ISR_ENABLE

//
// This array will be used as a trace to check the order that the interrupts were serviced
//
uint16_t  traceISR[TRACE_SIZE];

//
// Index to update an element in the trace buffer
//
uint16_t  traceISRIndex = 0;

#endif


#if 0

//
//  CPU Timer 1 Interrupt (INT13)
//
__interrupt void TIMER1_ISR(void)
{
    //
    // Set the global priority to allow CPU interrupts with higher priority
    //
    IER &= MINT13;
    EINT;

    //
    // Insert ISR Code here ..
    //

    //
    // Disable Interrupts
    //
    DINT;

    #ifdef TRACE_ISR_ENABLE
        //
        //  Add ISR to Trace
        //
        traceISR[traceISRIndex % TRACE_SIZE] = 0x1300;
        traceISRIndex++;
    #endif
}


#endif
