Hi,
Can someone cast their eyes over my code please and tell me what I'm doing wrong.
I'm wanting to setup a Callback function for the UART such that I'm not blocking any processing whilst waiting for a response to an earlier UART command. I've read the various Forum posts and Google, etc and this is my code...
Top of file...
#include <ti/drivers/UART.h>
...
void uart_callback_read (UART_Handle handle, void *buffer, int size);
Within Task...
UART_Handle uart;
UART_Params uartParams;
UART_Params_init(&uartParams);
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.readMode = UART_MODE_CALLBACK;
uartParams.readCallback = &uart_callback_read;
#ifdef DEBUG_INFO
uartParams.baudRate = 115200;
#else
uartParams.baudRate = 19200;
#endif
uart = UART_open(Board_UART0, &uartParams);
Bottom of file...
void uart_callback_read (UART_Handle handle, void *buffer, int size) {
/*Leave Blank for now until successul compile... */
}
I then have a UART_Write(uart, &command, CMD_LEN) followed by a UART_Read(uart, &response, RESP_LEN), where I expect the Callback to be called when RESP_LEN has been received.
Now, I get the following Warning when I compile:
#515-D a value of type "void (*)(UART_Handle, void *, int)" cannot be assigned to an entity of type "UART_Callback"
I don't like Warnings like this, what would cause this Warning and how do I resolve it?
Any Pointers (no pun intended) welcome.
Thankyou,
Mike.