Hi,
I'm triying to make a UART library of CC2541 and I don't know whats going on. I just have a task(working) that initializes the UART with a callback function, this is the code:
void UART_Receiver_Init( uint8 task_id ){
UART_Receiver_TaskID=task_id;
// Configure UART
halUARTCfg_t uartConfig;
uartConfig.configured = TRUE;
uartConfig.baudRate = HAL_UART_BR_9600;
uartConfig.flowControl = FALSE;
uartConfig.flowControlThreshold = 48;
uartConfig.rx.maxBufSize = 1024;
uartConfig.tx.maxBufSize = 1024;
uartConfig.idleTimeout = 6;
uartConfig.intEnable = TRUE;
uartConfig.callBackFunc = UART_Listener_CB;
HalUARTOpen( V_UART_PORT, &uartConfig );
HCI_EXT_HaltDuringRfCmd(HCI_EXT_HALT_DURING_RF_DISABLE);
osal_start_timerEx(UART_Receiver_TaskID,START_UART_COMMUNICATION,500);
}
And in the call back function I just have a debug message.
The problem is that it never get into the callback.
I defined this macros:
INT_HEAP_LEN=3072
HALNODEBUG
OSAL_CBTIMER_NUM_TASKS=1
TRUE=1
FALSE=0
#define UART_PORT HAL_UART_PORT_0 #define HAL_UART TRUE #define HAL_UART_DMA 1 #define HAL_DMA TRUE
Does someone know what could be missing in my code? I already checked the connections between CC2541 and Arduino.
Cheers!
Vicente