This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I was using the uart2callback project, which echoes characters. However, I'm looking to echo words or strings instead.
That means, while uart_read currently reads character, I want to modify it so that uart_read reads input until the Enter key is pressed
Hi,
UART2_read takes in a target number of bytes to read, rather than an end token.
This is to make use of the DMA (which needs to know the number of bytes per transfer), which reduces overhead on the CPU for transferring data.
So ending the UART RX on detecting a '/n' is not possible out of box.
You'd need to add some additional logic to process the input characters until the end character is received (in your case '\n').
Thanks,
Toby