Loopback VT/ANSI Terminal
void print_info()
{
Terminal.
write(
"\e[37m* * FabGL - Loopback VT/ANSI Terminal\r\n");
Terminal.
write(
"\e[34m* * 2019-2020 by Fabrizio Di Vittorio - www.fabgl.com\e[32m\r\n\n");
Terminal.printf(
"\e[32mTerminal Size :\e[33m %d x %d\r\n", Terminal.
getColumns(), Terminal.
getRows());
Terminal.printf("\e[32mFree DMA Memory :\e[33m %d\r\n", heap_caps_get_free_size(MALLOC_CAP_DMA));
Terminal.printf("\e[32mFree 32 bit Memory :\e[33m %d\r\n\n", heap_caps_get_free_size(MALLOC_CAP_32BIT));
Terminal.
write(
"\e[32mFree typing test - press ESC to introduce escape VT/ANSI codes\r\n\n");
}
void setup()
{
Serial.begin(115200);
PS2Controller.
begin(PS2Preset::KeyboardPort0);
DisplayController.
begin();
Terminal.
begin(&DisplayController);
print_info();
}
void loop()
{
char c = Terminal.
read();
switch (c) {
case 0x7F:
Terminal.
write(
"\b\e[K");
break;
case 0x0D:
break;
default:
break;
}
}
}