AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/at91sam7s/rs485.c
bool RS485_DataAvailable(
    uint8_t * DataRegister)
{
    bool DataAvailable = false;
    /* LED on send */
    volatile AT91PS_PIO pPIO = AT91C_BASE_PIOA;

    if (RS485_Interface->US_CSR & AT91C_US_RXRDY) {
        /* data is available */
        if (DataRegister) {
            *DataRegister = RS485_Interface->US_RHR;
        }
        DataAvailable = true;
        /* LED ON */
        pPIO->PIO_CODR = LED2;
    }

    return DataAvailable;
}
/****************************************************************************
* DESCRIPTION: Return true if data is available
* RETURN:      true if data is available, with the data in the parameter set
* ALGORITHM:   none
* NOTES:       none
*****************************************************************************/
Return true if data is available
RETURN:      true if data is available, with the data in the parameter set
ALGORITHM:   none
NOTES:       none
Return true if data is available RETURN : true if data is available with the data in the parameter set ALGORITHM : none NOTES : none
bool RS485_DataAvailable(
    uint8_t * DataRegister)
{
    bool DataAvailable = false;
    volatile AT91PS_PIO pPIO = AT91C_BASE_PIOA;
    if (RS485_Interface->US_CSR & AT91C_US_RXRDY) {
        if (DataRegister) {
            *DataRegister = RS485_Interface->US_RHR;
        }
        DataAvailable = true;
        pPIO->PIO_CODR = LED2;
    }
    return DataAvailable;
}
bool RS485_DataAvailable ( uint8_t * DataRegister ) { bool DataAvailable = false ; volatile AT91PS_PIO pPIO = AT91C_BASE_PIOA ; if ( RS485_Interface -> US_CSR & AT91C_US_RXRDY ) { if ( DataRegister ) { * DataRegister = RS485_Interface -> US_RHR ; } DataAvailable = true ; pPIO -> PIO_CODR = LED2 ; } return DataAvailable ; }
DESCRIPTION: Return true if data is available
RETURN:      true if data is available, with the data in the parameter set
ALGORITHM:   none
NOTES:       none
DESCRIPTION : Return true if data is available RETURN : true if data is available with the data in the parameter set ALGORITHM : none NOTES : none
/* LED on send */ /* data is available */ /* LED ON */