mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Check if Display is valid
This commit is contained in:
parent
5c1eb4d2bf
commit
3f1467378e
11
Kernel.cpp
11
Kernel.cpp
@ -7,6 +7,7 @@
|
|||||||
#include <convert.h>
|
#include <convert.h>
|
||||||
#include <printf.h>
|
#include <printf.h>
|
||||||
#include <lock.hpp>
|
#include <lock.hpp>
|
||||||
|
#include <uart.hpp>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <smp.hpp>
|
#include <smp.hpp>
|
||||||
#include <cargs.h>
|
#include <cargs.h>
|
||||||
@ -182,7 +183,13 @@ extern bool EnableProfiler;
|
|||||||
|
|
||||||
// For the Display class. Printing on first buffer as default.
|
// For the Display class. Printing on first buffer as default.
|
||||||
int PutCharBufferIndex = 0;
|
int PutCharBufferIndex = 0;
|
||||||
EXTERNC void putchar(char c) { Display->Print(c, PutCharBufferIndex); }
|
EXTERNC void putchar(char c)
|
||||||
|
{
|
||||||
|
if (Display)
|
||||||
|
Display->Print(c, PutCharBufferIndex);
|
||||||
|
else
|
||||||
|
UniversalAsynchronousReceiverTransmitter::UART(UniversalAsynchronousReceiverTransmitter::COM1).Write(c);
|
||||||
|
}
|
||||||
|
|
||||||
EXTERNC void KPrint(const char *Format, ...)
|
EXTERNC void KPrint(const char *Format, ...)
|
||||||
{
|
{
|
||||||
@ -197,7 +204,7 @@ EXTERNC void KPrint(const char *Format, ...)
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
if (!Config.BootAnimation)
|
if (!Config.BootAnimation && Display)
|
||||||
Display->SetBuffer(0);
|
Display->SetBuffer(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user