Fix for display uart printing colors

This commit is contained in:
Alex 2022-10-16 20:58:35 +03:00
parent b8c5c15a47
commit 31f83fe0f7
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -14,8 +14,6 @@ namespace Video
char Display::Print(char Char, int Index, bool WriteToUART) char Display::Print(char Char, int Index, bool WriteToUART)
{ {
SMARTLOCK(PrintLock); SMARTLOCK(PrintLock);
if (WriteToUART)
UniversalAsynchronousReceiverTransmitter::UART(UniversalAsynchronousReceiverTransmitter::COM1).Write((char)Char);
if (this->ColorIteration) if (this->ColorIteration)
{ {
@ -29,19 +27,25 @@ namespace Video
else else
this->Buffers[Index]->Color = 0; this->Buffers[Index]->Color = 0;
UniversalAsynchronousReceiverTransmitter::UART(UniversalAsynchronousReceiverTransmitter::COM1).Write(Char);
this->ColorPickerIteration++; this->ColorPickerIteration++;
if (this->ColorPickerIteration == 6) if (this->ColorPickerIteration == 6)
{ {
this->ColorPickerIteration = 0; this->ColorPickerIteration = 0;
UniversalAsynchronousReceiverTransmitter::UART(UniversalAsynchronousReceiverTransmitter::COM1).Write(']');
this->ColorIteration = false; this->ColorIteration = false;
} }
return Char; return Char;
} }
if (WriteToUART)
UniversalAsynchronousReceiverTransmitter::UART(UniversalAsynchronousReceiverTransmitter::COM1).Write(Char);
switch (Char) switch (Char)
{ {
case '\e': case '\e':
{ {
UniversalAsynchronousReceiverTransmitter::UART(UniversalAsynchronousReceiverTransmitter::COM1).Write('[');
this->ColorIteration = true; this->ColorIteration = true;
return Char; return Char;
} }