Part Number: CC2640R2F
HI,
Below is the UART task created , aim is to receive Data from PC terminal but not able to receive.
Is there any thing missing in task creation ?
UART_createTask() is called from main routine.
/* Macros ---------------------------------------------------------------- */
#define UART_TASK_STACK_SIZE 400u
#define UART_TASK_PRIORITY 2u
#define RX_BUF_SIZE 20u
#define TX_BUF_SIZE 20u
/* Private functions ----------------------------------------------------- */
static Void UARTtaskFxn(UArg arg0, UArg arg1);
void UART_createTask(void);
/* Private variables ----------------------------------------------------- */
Char UARTTaskStack[ UART_TASK_STACK_SIZE ];
Task_Struct UARTStruct;
UART_Params UARTParam;
UART_Handle UART;
uint8_t aUARTRxBuf[RX_BUF_SIZE];
uint8_t aTxBuf[TX_BUF_SIZE];
unsigned char fRxData = 0;
/*********************************************************************
* @fn UART_createTask
*/
void UART_createTask(void)
{
Task_Params taskParams;
// Configure task
Task_Params_init(&taskParams);
taskParams.stack = UARTTaskStack;
taskParams.stackSize = UART_TASK_STACK_SIZE;
taskParams.priority = UART_TASK_PRIORITY;
//taskParams.arg0 = 100000/Clock_tickPeriod;
Task_construct(&UARTStruct, UARTtaskFxn, &taskParams, NULL);
}
static void UARTtaskFxn(UArg arg0, UArg arg1)
{
UART_init();
// Create a UART with data processing off.
UART_Params_init( &UARTParam );
UARTParam.writeDataMode = UART_DATA_BINARY;
UARTParam.readDataMode = UART_DATA_BINARY;
UARTParam.readReturnMode = UART_RETURN_NEWLINE;
UARTParam.readEcho = UART_ECHO_OFF;
UARTParam.baudRate = 9600u;
UARTParam.readTimeout = 10000u;
UART = UART_open( Board_UART0, &UARTParam );
if ( UART == NULL )
{
while ( 1 );
}
while( 1 )
{
while (UART_read(UART, aUARTRxBuf, 1u ) > 0)
{
fRxData = 1;
}
}
}
Regards,
Bhavin