#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <ports.h>

/*******************************************************************
* Function Name     : ConfigINT3
* Description       : Enables external interrupt on pin INT3
* Parameters        : config determines the interrupt edge, priority 
*                     and enable/disable information.
* Return Value      : None
********************************************************************/
#ifdef _INT3

void ConfigINT3(unsigned int config)
{

    IFS3bits.INT3IF = 0;                       /* clear the interrupt flag */
    IPC13bits.INT3IP = config & 0x07;           /* assign interrupt priority */
    IEC3bits.INT3IE = (config & 0x08) >> 3;    /* enable/disable interrupt */

    INTCON2bits.INT3EP = (config & 0x10) >> 4; /* assign edge selected */

    
}
/* end of function ConfigINT3 */

#else
#warning "Does not build on this target"
#endif
