Kernel: TTY now reads input byte by byte
This allows correct behaviour for character streams / keyboard handling. Serial input can now send working ^C :D
This commit is contained in:
@@ -244,12 +244,13 @@ namespace Kernel
|
||||
if (m_serial.port() != COM1_PORT && m_serial.port() != COM2_PORT)
|
||||
return;
|
||||
|
||||
static uint8_t buffer[128];
|
||||
|
||||
auto update_com =
|
||||
[&](auto& device, auto& input_queue)
|
||||
{
|
||||
if (input_queue.empty())
|
||||
return;
|
||||
uint8_t buffer[128];
|
||||
uint8_t* ptr = buffer;
|
||||
while (!input_queue.empty())
|
||||
{
|
||||
@@ -262,7 +263,10 @@ namespace Kernel
|
||||
ptr++;
|
||||
}
|
||||
*ptr = '\0';
|
||||
device->handle_input(buffer);
|
||||
|
||||
ptr = buffer;
|
||||
while (*ptr)
|
||||
device->handle_input_byte(*ptr++);
|
||||
};
|
||||
|
||||
CriticalScope _;
|
||||
|
||||
Reference in New Issue
Block a user