View Single Post
Old 08-29-2015, 03:14 PM   #17 (permalink)
thingstodo
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
Quote:
Originally Posted by Piotrsko View Post
Long time ago in a galaxy far far away, we had a command for terminal programs run on command prompt : Echo on. Default is "off"
After getting a pin soldered on the serial buffer, I can confirm that echo defaults to ON, like this code shows.

Code:
while (1) {
		wdt_reset();
		x = uart_getch();
		if (x >= 0) {
			if (x != 0x0d) {
				// not a CR
				uart_putch(x);							// echo the character back
				if (cmdpos < (sizeof(cmd) - 1)) {
					cmd[cmdpos++] = x;					// add character to command string
					cmd[cmdpos] = 0;					// and terminate command string
				}
			}
  Reply With Quote