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

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

void ConfigINT1(unsigned int config)
{
    IFS1bits.INT1IF = 0;     /* clear the interrupt flag */

    IPC5bits.INT1IP = config & 0x07;           /* assign interrupt priority  for 33F and 24H*/

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

    IEC1bits.INT1IE = (config & 0x08) >> 3;    /* enable/disable interrupt */
}
/* end of function ConfigINT1 */

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