added change for windows

This commit is contained in:
Robin Müller 2021-01-03 13:25:42 +01:00
parent 087482300d
commit 61fc6cac97
1 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,10 @@
#include <cstring>
#include <inttypes.h>
#if defined(WIN32) && FSFW_COLORED_OUTPUT == 1
#include "Windows.h"
#endif
// to be implemented by bsp
extern "C" void printChar(const char*, bool errStream);
@ -33,6 +37,15 @@ ServiceInterfaceBuffer::ServiceInterfaceBuffer(std::string setMessage,
else if(setMessage.find("ERROR")) {
colorPrefix = fsfw::ANSI_COLOR_RED;
}
#ifdef WIN32
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD dwMode = 0;
GetConsoleMode(hOut, &dwMode);
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(hOut, dwMode);
#endif
#endif
preamble.reserve(MAX_PREAMBLE_SIZE);