AnsweredAssumed Answered

to control the UART Rx wait time

Question asked by lcheng Employee on Jun 25, 2015
Latest reply on Aug 26, 2015 by SachinV

Hi,

 

I am using CCES 2.0.0 to debug ADSP-SC589 EZ-Board. My application is using the UART driver from the CCES lib. It is adi_uart_bf60x.c(in folder CrossCore Embedded Studio 2.0.0\ARM\arm-none-eabi\arm-none-eabi\lib\src\drivers\Source\uart). The code for UART Read looks like:

 

static ADI_UART_RESULT GetBuffer(

    ADI_UART_DEVICE     const  *pDevice,
    ADI_UART_CHANNEL           *pChannel,
    void                      **ppBuffer
)
{
    ADI_UART_RESULT     eResult = ADI_UART_SUCCESS;
    ADI_UART_BUF_INFO  *pBufInfo;

 

/* Wait until a processed buffer is available using
     * Semaphore pend. The Semaphore pend will return immediately
     * is there is buffer available. */
    if(adi_osal_SemPend(pChannel->hSemaphore,
                        ADI_OSAL_TIMEOUT_FOREVER) != ADI_OSAL_SUCCESS)

 

 

 

Here ADI_OSAL_TIMEOUT_FOREVER tells UART to wait until it gets some input. While ADI_OSAL_TIMEOUT_NONE is more reasonable in my application. If no data received from UART,  UART Rx shall exit immediately.

 

Is there any way for me to control which timeout to use? ADI_OSAL_TIMEOUT_NONE or ADI_OSAL_TIMEOUT_FOREVER or other values?

 

Thanks.

Cheng

 

 

Outcomes