- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My basic idea for this code is I will keep getChar from keyboard until I hit ENTER key.
However, it is not working if I type 1 2 3 ENTER. It will stuck in while(UART_GetRxBufferSize() < size_start_num) until I enter 3 more digits then '123' will appear in Tera Term
Code is attached here
Simon
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have two lines where you get the data from UART. Line 47 and 63
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look at your last received character. when it is a number you save it in your result array, when it id a newline you are done. Otherwise it is an error. Classical structure for a "switch" statement.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is I stuck in while(UART_GetRxBufferSize() < size_start_num) if I just type 1 2 3 ENTER
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have two lines where you get the data from UART. Line 47 and 63
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
but line 47 is getchar while 63 is readRxdata. These two are similar?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK I see, both then are reading rxBuffer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content