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


/* UART2 is defined in following devices */
#ifdef _UART_IRDA_V1_2

/*********************************************************************
* Function Name     : WriteUART2                                     *
* Description       : This function writes data into the UxTXREG,    *
* Parameters        : unsigned int data the data to be written       *
* Return Value      : None                                           *
*********************************************************************/

void WriteUART2(unsigned int data)
{
    if(U2MODEbits.PDSEL == 3)
        U2TXREG = data;
    else
        U2TXREG = data & 0xFF;  
}

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