mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
Kernel: Add logic to RPi UART driver to emit CR when encountering LF
This makes sure that the debug message are properly aligned when running the kernel bare-metal on a Raspberry Pi. While we are here, also move the function out of line.
This commit is contained in:
parent
e0d7d3c3d5
commit
22aea9f659
2 changed files with 11 additions and 5 deletions
|
@ -128,6 +128,16 @@ void UART::send(u32 c)
|
|||
m_registers->data = c;
|
||||
}
|
||||
|
||||
void UART::print_str(char const* s, size_t length)
|
||||
{
|
||||
for (size_t i = 0; i < length; ++i) {
|
||||
char character = *s++;
|
||||
if (character == '\n')
|
||||
send('\r');
|
||||
send(character);
|
||||
}
|
||||
}
|
||||
|
||||
u32 UART::receive()
|
||||
{
|
||||
wait_until_we_can_receive();
|
||||
|
|
|
@ -22,11 +22,7 @@ public:
|
|||
void send(u32 c);
|
||||
u32 receive();
|
||||
|
||||
void print_str(char const* s, size_t length)
|
||||
{
|
||||
for (size_t i = 0; i < length; ++i)
|
||||
send(*s++);
|
||||
}
|
||||
void print_str(char const*, size_t);
|
||||
|
||||
private:
|
||||
UART();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue