diff --git a/base-hw/src/base/console.cc b/base-hw/src/base/console.cc index 74072cebfb..cb7b92a0fe 100644 --- a/base-hw/src/base/console.cc +++ b/base-hw/src/base/console.cc @@ -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: diff --git a/base/include/drivers/uart/pl011_base.h b/base/include/drivers/uart/pl011_base.h index 9aa0b040f8..85b061bd91 100644 --- a/base/include/drivers/uart/pl011_base.h +++ b/base/include/drivers/uart/pl011_base.h @@ -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()) ; - /* auto complete new line commands */ - if (c == ASCII_LINE_FEED) write(ASCII_CARRIAGE_RETURN); - /* transmit character */ write(c); _wait_until_ready(); diff --git a/base/include/drivers/uart/tl16c750_base.h b/base/include/drivers/uart/tl16c750_base.h index 493de9752a..c96ac1eb18 100644 --- a/base/include/drivers/uart/tl16c750_base.h +++ b/base/include/drivers/uart/tl16c750_base.h @@ -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()) ; - /* auto complete new line commands */ - if (c == ASCII_LINE_FEED) - write(ASCII_CARRIAGE_RETURN); - /* transmit character */ write(c); }