base: Don't complete line breaks in UART drivers.

This commit is contained in:
Martin Stein 2012-11-13 09:51:32 +01:00 committed by Norman Feske
parent f51ce6f5a5
commit 240f1e334f
3 changed files with 15 additions and 19 deletions

View File

@ -31,7 +31,20 @@ namespace Genode
/**
* Print a char to the console
*/
void _out_char(char c) { Serial_log::put_char(c); }
void _out_char(char c)
{
enum {
ASCII_LINE_FEED = 10,
ASCII_CARRIAGE_RETURN = 13,
};
/* auto complete new line commands */
if (c == ASCII_LINE_FEED)
Serial_log::put_char(ASCII_CARRIAGE_RETURN);
/* print char */
Serial_log::put_char(c);
}
public:

View File

@ -26,12 +26,7 @@ namespace Genode
{
protected:
enum {
MAX_BAUD_RATE = 0xfffffff,
ASCII_LINE_FEED = 10,
ASCII_CARRIAGE_RETURN = 13,
};
enum { MAX_BAUD_RATE = 0xfffffff };
/**
* Data register
@ -175,9 +170,6 @@ void Genode::Pl011_base::put_char(char const c)
/* wait as long as the transmission buffer is full */
while (read<Uartfr::Txff>()) ;
/* auto complete new line commands */
if (c == ASCII_LINE_FEED) write<Uartdr::Data>(ASCII_CARRIAGE_RETURN);
/* transmit character */
write<Uartdr::Data>(c);
_wait_until_ready();

View File

@ -19,11 +19,6 @@
namespace Genode
{
enum {
ASCII_LINE_FEED = 10,
ASCII_CARRIAGE_RETURN = 13,
};
/**
* Base driver Texas instruments TL16C750 UART module
*
@ -219,10 +214,6 @@ namespace Genode
/* wait as long as the transmission buffer is full */
while (!read<Uart_lsr::Tx_fifo_empty>()) ;
/* auto complete new line commands */
if (c == ASCII_LINE_FEED)
write<Uart_thr::Thr>(ASCII_CARRIAGE_RETURN);
/* transmit character */
write<Uart_thr::Thr>(c);
}