Tool/software: Code Composer Studio
Hello,
I am using the UART.h driver and I want to be able to write individual commands one after another. For example...
uint8_t stopText[13] = {0xA5, 0x5A, 0x0A, 0x82, 0x01, 0xF2, 0x53, 0x54, 0x4f,
0x50, 0x50, 0x45, 0x44};
uint8_t stopColor[8] = {0xA5, 0x5A, 0x05, 0x82, 0x40, 0x03, 0x88, 0x02};
UART_write(uart, stopText, sizeof(stopText));
UART_write(uart, stopColor, sizeof(stopColor));
When I have this set of commands, I run into an issue where the second UART_write is not written.
My Uart initialization is run in a task and is as follows :
void uartRxFxn(UArg a0, UArg a1){
// Init UART
UART_init();
// Specify non-default parameters
UART_Params_init(&uartParams);
uartParams.baudRate = 9600;
uartParams.writeMode = UART_MODE_CALLBACK;
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.writeCallback = writeCallback;
uartParams.readMode = UART_MODE_CALLBACK;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readCallback = readCallback;
uartParams.readReturnMode = UART_RETURN_FULL;
// Open the UART and initiate the first read
uart = UART_open(CONFIG_UART_0, &uartParams);
UART_write(uart, tester, sizeof(tester));
wantedRxBytes = 9;
int rxBytes = UART_read(uart, rxBuf, wantedRxBytes);
}
Please help as it is very imporant that I do not have to create a long message for every single combination of commands I want to send.
Cheers!