FreeRTOS console and io devices support for compile

git-svn-id: svn://db.shs.com.ru/pip@688 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2019-02-06 13:04:25 +00:00
parent 30973842d1
commit 283da5b602
17 changed files with 185 additions and 63 deletions

View File

@@ -91,12 +91,16 @@ PIConsole::PIConsole(bool startNow, PIKbdListener::KBFunc slot): PIThread() {
GetConsoleMode(PRIVATE->hOut, &PRIVATE->smode);
GetConsoleCursorInfo(PRIVATE->hOut, &PRIVATE->curinfo);
#else
# ifdef FREERTOS
width = 80;
height = 24;
# else
winsize ws;
ioctl(0, TIOCGWINSZ, &ws);
width = ws.ws_col;
height = ws.ws_row;
# endif
#endif
tabs.reserve(16);
addTab("main");
listener = new PIKbdListener(key_event, this);
peer_timer = new PITimer();
@@ -544,10 +548,15 @@ void PIConsole::run() {
width = PRIVATE->sbi.srWindow.Right - PRIVATE->sbi.srWindow.Left;
height = PRIVATE->sbi.srWindow.Bottom - PRIVATE->sbi.srWindow.Top;
#else
# ifdef FREERTOS
width = 80;
height = 24;
# else
winsize ws;
ioctl(0, TIOCGWINSZ, &ws);
width = ws.ws_col;
height = ws.ws_row;
# endif
#endif
//fflush(0); return;
PICout::__mutex__().lock();
@@ -634,10 +643,15 @@ void PIConsole::fillLabels() {
width = PRIVATE->sbi.srWindow.Right - PRIVATE->sbi.srWindow.Left;
height = PRIVATE->sbi.srWindow.Bottom - PRIVATE->sbi.srWindow.Top;
#else
# ifdef FREERTOS
width = 80;
height = 24;
# else
winsize ws;
ioctl(0, TIOCGWINSZ, &ws);
width = ws.ws_col;
height = ws.ws_row;
# endif
#endif
max_y = 0;
col_cnt = columns().size();

View File

@@ -62,10 +62,15 @@ PIScreen::SystemConsole::SystemConsole() {
GetConsoleMode(PRIVATE->hOut, &PRIVATE->smode);
GetConsoleCursorInfo(PRIVATE->hOut, &PRIVATE->curinfo);
#else
# ifdef FREERTOS
w = 80;
h = 24;
# else
winsize ws;
ioctl(0, TIOCGWINSZ, &ws);
w = ws.ws_col;
h = ws.ws_row;
# endif
#endif
resize(w, h);
}
@@ -109,10 +114,15 @@ void PIScreen::SystemConsole::prepare() {
w = PRIVATE->csbi.srWindow.Right - PRIVATE->csbi.srWindow.Left + 1;
h = PRIVATE->csbi.srWindow.Bottom - PRIVATE->csbi.srWindow.Top + 1;
#else
# ifdef FREERTOS
w = 80;
h = 24;
# else
winsize ws;
ioctl(0, TIOCGWINSZ, &ws);
w = ws.ws_col;
h = ws.ws_row;
# endif
#endif
resize(w, h);
}

View File

@@ -189,7 +189,7 @@ void PIScreenTile::layout() {
}
if (as <= ts) {
int acnt(0);
SizePolicy pol;
SizePolicy pol = Fixed;
if (ecnt > 0) {
acnt = ecnt;
pol = Expanding;

View File

@@ -19,6 +19,7 @@
#include "piincludes_p.h"
#include "piterminal.h"
#include "pisharedmemory.h"
#ifndef FREERTOS
#ifdef WINDOWS
# include <windows.h>
# include <wincon.h>
@@ -911,3 +912,5 @@ bool PITerminal::resize(int cols, int rows) {
cells[i].resize(size_x);
return ret;
}
#endif // FREERTOS