Update circle_stdlib_app.h

Update to e880dc0ed1
pull/419/head
probonopd 2 years ago committed by GitHub
parent 7e874cf427
commit fd0b88a57f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 39
      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 * Convenience classes that package different levels
* of functionality of Circle applications. * of functionality of Circle applications.
* *
@ -22,7 +19,6 @@
#include <circle/interrupt.h> #include <circle/interrupt.h>
#include <circle/screen.h> #include <circle/screen.h>
#include <circle/serial.h> #include <circle/serial.h>
#include <circle/writebuffer.h>
#include <circle/timer.h> #include <circle/timer.h>
#include <circle/logger.h> #include <circle/logger.h>
#include <circle/usb/usbhcidevice.h> #include <circle/usb/usbhcidevice.h>
@ -95,9 +91,7 @@ class CStdlibAppScreen : public CStdlibApp
public: public:
CStdlibAppScreen(const char *kernel) CStdlibAppScreen(const char *kernel)
: CStdlibApp (kernel), : CStdlibApp (kernel),
mScreenUnbuffered (mOptions.GetWidth (), mOptions.GetHeight ()), mScreen (mOptions.GetWidth (), mOptions.GetHeight ()),
mScreen (&mScreenUnbuffered),
mbScreenAvailable (false),
mTimer (&mInterrupt), mTimer (&mInterrupt),
mLogger (mOptions.GetLogLevel (), &mTimer) mLogger (mOptions.GetLogLevel (), &mTimer)
{ {
@ -110,13 +104,16 @@ public:
return false; return false;
} }
mbScreenAvailable = mScreenUnbuffered.Initialize (); if (!mScreen.Initialize ())
#if 0 {
return false;
}
if (!mSerial.Initialize (115200)) if (!mSerial.Initialize (115200))
{ {
return false; return false;
} }
#endif
CDevice *pTarget = CDevice *pTarget =
mDeviceNameService.GetDevice (mOptions.GetLogDevice (), false); mDeviceNameService.GetDevice (mOptions.GetLogDevice (), false);
if (pTarget == 0) if (pTarget == 0)
@ -133,10 +130,8 @@ public:
} }
protected: protected:
CScreenDevice mScreenUnbuffered; CScreenDevice mScreen;
//CSerialDevice mSerial; CSerialDevice mSerial;
CWriteBufferDevice mScreen;
bool mbScreenAvailable;
CTimer mTimer; CTimer mTimer;
CLogger mLogger; CLogger mLogger;
}; };
@ -162,12 +157,7 @@ public:
mpPartitionName (pPartitionName), mpPartitionName (pPartitionName),
mUSBHCI (&mInterrupt, &mTimer, TRUE), mUSBHCI (&mInterrupt, &mTimer, TRUE),
mEMMC (&mInterrupt, &mTimer, &mActLED), mEMMC (&mInterrupt, &mTimer, &mActLED),
#if !defined(__aarch64__) || !defined(LEAVE_QEMU_ON_HALT) mConsole (0, TRUE)
//mConsole (&mScreen, TRUE)
mConsole (&mNullDevice, &mScreen)
#else
mConsole (&mScreen)
#endif
{ {
} }
@ -199,23 +189,18 @@ public:
return false; 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 ()) if (!mUSBHCI.Initialize ())
{ {
return false; return false;
} }
#endif
if (!mConsole.Initialize ()) if (!mConsole.Initialize ())
{ {
return false; return false;
} }
// Initialize newlib stdio with a reference to Circle's file system and console // Initialize newlib stdio with a reference to Circle's console
CGlueStdioInit (mFileSystem, mConsole); CGlueStdioInit (mConsole);
mLogger.Write (GetKernelName (), LogNotice, "Compile time: " __DATE__ " " __TIME__); mLogger.Write (GetKernelName (), LogNotice, "Compile time: " __DATE__ " " __TIME__);

Loading…
Cancel
Save