|
|
|
@ -108,7 +108,6 @@ int console_getline(struct console *console_, char *buf, size_t n) |
|
|
|
|
switch (c) { |
|
|
|
|
case '\r': |
|
|
|
|
usart_send_blocking(console->dev, '\r'); |
|
|
|
|
usart_send_blocking(console->dev, '\n'); |
|
|
|
|
return 0; |
|
|
|
|
case 10: |
|
|
|
|
case 127: |
|
|
|
@ -197,8 +196,13 @@ static ssize_t usart_write(void *cookie, const char *buf, size_t n) |
|
|
|
|
size_t i; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < n; ++i) { |
|
|
|
|
if (buf[i] == '\n') |
|
|
|
|
if (buf[i] == '\r') |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
if (buf[i] == '\n') { |
|
|
|
|
usart_send_blocking(console->dev, '\r'); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
usart_send_blocking(console->dev, buf[i]); |
|
|
|
|
}; |
|
|
|
|