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

/********************************************************************
* Function Name     : ConfigIntCN
* Description       : Enables/Disables the individual CN interrupts 
*                     and sets priority and enables/disables CN.
* Parameters        : None
* Return Value      : None
*********************************************************************/

void ConfigIntCN(long int config)
{
    IFS1bits.CNIF = 0;
    CNEN1 = (unsigned int)config;
    CNEN2 = (unsigned int)(config >> 16);

    config = config >> 24;
    IPC4bits.CNIP = config;
    IEC1bits.CNIE = config >> 3; 
}
/* end of function ConfigIntCN */
