Reroute stderr to uart and color it red

This commit is contained in:
Mario Hüttel 2020-04-20 01:06:25 +02:00
parent 83978e8188
commit d85381e30e
1 changed files with 6 additions and 0 deletions

View File

@ -89,6 +89,12 @@ int _write(int fd, const void *buf, int count)
{
if (fd == 1)
uart_send_array_with_dma(&shell_uart, (char *)buf, count);
else if (fd == 2) {
uart_send_string_with_dma(&shell_uart, "\e[31m");
uart_send_array_with_dma(&shell_uart, (char *)buf, count);
uart_send_string_with_dma(&shell_uart, "\e[m");
}
return count;
}