usart: do not send newlines

tags/0.1.0
S.J.R. van Schaik 8 years ago
parent dd6579fda7
commit 9922994d1c
  1. 8
      source/platform/usart.c

@ -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]);
};

Loading…
Cancel
Save