Tool/software: TI-RTOS
when I use many UART_write in the same function, the text and data I sent is not remain, some thing went wrong at the last of my string. Can you help me?
HERE IS MY CODE:
void read_cb(UART_Handle handle, void *rxbuff, size_t size) { //uint8_t i = 0, index = 0, length = 0; //char data[20] = {0}; char p1[] = "the Rx Buffer is:\r\n"; UART_write(handle, p1, sizeof(p1)); UART_write(handle, rxbuff, size); char p[] = "callback is active.\r\n"; UART_write(handle, p, sizeof(p)); UART_read(handle, rxbuff, size); } void Uart_communicate(UArg arg0, UArg arg1) { //uart_init_params(); UART_Params_init(&uartParams); uartParams.readMode = UART_MODE_CALLBACK; //uartParams.writeMode = UART_MODE_BLOCKING; //uartParams.readTimeout = UART_WAIT_FOREVER; //uartParams.writeTimeout = UART_WAIT_FOREVER; uartParams.readCallback = read_cb; //uartParams.writeCallback = NULL; //uartParams.readReturnMode = UART_RETURN_NEWLINE; uartParams.writeDataMode = UART_DATA_BINARY; uartParams.readDataMode = UART_DATA_BINARY; //uartParams.readEcho = UART_ECHO_OFF; uartParams.baudRate = 9600; //uartParams.dataLength = UART_LEN_8; uartHandle = UART_open(Board_UART0, &uartParams); UART_read(uartHandle, RxBuffer, BUFF_SIZE); while(1) { //UART_read(uartHandle, RxBuffer, BUFF_SIZE); //char p[] = "the Rx Buffer is:\r\n"; //UART_write(uartHandle, p, sizeof(p)); //UART_write(uartHandle, RxBuffer, BUFF_SIZE); } }