From fd0b88a57f2771156ad520e811d8f0713659ca93 Mon Sep 17 00:00:00 2001 From: probonopd Date: Fri, 20 Jan 2023 20:38:01 +0100 Subject: [PATCH] Update circle_stdlib_app.h Update to https://github.com/smuehlst/circle-stdlib/commit/e880dc0ed1a2a3b8da6523383336532797c0be0e --- src/circle_stdlib_app.h | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/src/circle_stdlib_app.h b/src/circle_stdlib_app.h index 75cbde2..c3c7aa3 100644 --- a/src/circle_stdlib_app.h +++ b/src/circle_stdlib_app.h @@ -1,7 +1,4 @@ /** - * This file has been taken from the circle-stdlib project: - * https://github.com/smuehlst/circle-stdlib - * * Convenience classes that package different levels * of functionality of Circle applications. * @@ -22,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -95,9 +91,7 @@ class CStdlibAppScreen : public CStdlibApp public: CStdlibAppScreen(const char *kernel) : CStdlibApp (kernel), - mScreenUnbuffered (mOptions.GetWidth (), mOptions.GetHeight ()), - mScreen (&mScreenUnbuffered), - mbScreenAvailable (false), + mScreen (mOptions.GetWidth (), mOptions.GetHeight ()), mTimer (&mInterrupt), mLogger (mOptions.GetLogLevel (), &mTimer) { @@ -110,13 +104,16 @@ public: return false; } - mbScreenAvailable = mScreenUnbuffered.Initialize (); -#if 0 + if (!mScreen.Initialize ()) + { + return false; + } + if (!mSerial.Initialize (115200)) { return false; } -#endif + CDevice *pTarget = mDeviceNameService.GetDevice (mOptions.GetLogDevice (), false); if (pTarget == 0) @@ -133,10 +130,8 @@ public: } protected: - CScreenDevice mScreenUnbuffered; - //CSerialDevice mSerial; - CWriteBufferDevice mScreen; - bool mbScreenAvailable; + CScreenDevice mScreen; + CSerialDevice mSerial; CTimer mTimer; CLogger mLogger; }; @@ -162,12 +157,7 @@ public: mpPartitionName (pPartitionName), mUSBHCI (&mInterrupt, &mTimer, TRUE), mEMMC (&mInterrupt, &mTimer, &mActLED), -#if !defined(__aarch64__) || !defined(LEAVE_QEMU_ON_HALT) - //mConsole (&mScreen, TRUE) - mConsole (&mNullDevice, &mScreen) -#else - mConsole (&mScreen) -#endif + mConsole (0, TRUE) { } @@ -199,23 +189,18 @@ public: return false; } -#if !defined(__aarch64__) || !defined(LEAVE_QEMU_ON_HALT) - // The USB driver is not supported under 64-bit QEMU, so - // the initialization must be skipped in this case, or an - // exit happens here under 64-bit QEMU. if (!mUSBHCI.Initialize ()) { return false; } -#endif if (!mConsole.Initialize ()) { return false; } - // Initialize newlib stdio with a reference to Circle's file system and console - CGlueStdioInit (mFileSystem, mConsole); + // Initialize newlib stdio with a reference to Circle's console + CGlueStdioInit (mConsole); mLogger.Write (GetKernelName (), LogNotice, "Compile time: " __DATE__ " " __TIME__);