We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have retarget fgets() and fputs() to ITM_ReceiveChar and ITM_SendChar.
When i test fgets() to get a string form Debug View, i find i can not input a new line charater (0x0A). Push "Enter" just send 0x0D, not 0x0A.
How input a new line char form Debug View?
Take a look at an ASCII code table; eg, http://www.asciitable.com/
The first column of "Control" codes (00-1F) correspond to holding down the Control (Ctrl) key while pressing the corresponding letter key (40-5F)
Thus, Ctrl+J = 0A = LF and Ctrl+M = 0D = CR
Note that there isn't actually any such thing as a newline character:
There's Line-Feed (LF) and Carriage-Return (CR), and different systems use CR and/or LF to mark the position of a newline - but there is no specific newline character as such.
great thanks.