allow console on either screen

This commit is contained in:
Dave Murphy 2014-12-12 13:43:40 +00:00
parent d6a58d4a2f
commit a39890ef48
2 changed files with 11 additions and 5 deletions

View File

@ -123,10 +123,11 @@ PrintConsole* consoleGetDefault(void);
PrintConsole *consoleSelect(PrintConsole* console);
/*! \brief Initialise the console.
\param screen The screen to use for the console
\param console A pointer to the console data to initialze (if it's NULL, the default console will be used)
\return A pointer to the current console.
*/
PrintConsole* consoleInit(PrintConsole* console);
PrintConsole* consoleInit(gfxScreen_t screen, PrintConsole* console);
//! Clears the screan by using iprintf("\x1b[2J");
void consoleClear(void);

View File

@ -342,7 +342,7 @@ static const devoptab_t dotab_null = {
};
//---------------------------------------------------------------------------------
PrintConsole* consoleInit(PrintConsole* console) {
PrintConsole* consoleInit(gfxScreen_t screen, PrintConsole* console) {
//---------------------------------------------------------------------------------
static bool firstConsoleInit = true;
@ -367,9 +367,14 @@ PrintConsole* consoleInit(PrintConsole* console) {
console->consoleInitialised = 1;
gfxSetScreenFormat(GFX_BOTTOM,GSP_RGB565_OES);
gfxSetDoubleBuffering(GFX_BOTTOM,false);
console->frameBuffer = (u16*)gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, NULL, NULL);
gfxSetScreenFormat(screen,GSP_RGB565_OES);
gfxSetDoubleBuffering(screen,false);
console->frameBuffer = (u16*)gfxGetFramebuffer(screen, GFX_LEFT, NULL, NULL);
if(screen==GFX_TOP) {
console->consoleWidth = 50;
console->windowWidth = 50;
}
consoleCls('2');