Move __check_failed to Log.cpp so it can be logged across all backends
This commit is contained in:
parent
1d51935d43
commit
29dad5651d
@ -1,4 +1,5 @@
|
||||
#include "Log.h"
|
||||
#include "arch/CPU.h"
|
||||
#include "arch/Serial.h"
|
||||
#include "arch/Timer.h"
|
||||
#include "video/TextConsole.h"
|
||||
@ -113,3 +114,15 @@ bool log_text_console_enabled()
|
||||
{
|
||||
return g_text_console_enabled;
|
||||
}
|
||||
|
||||
static bool g_check_already_failed = false;
|
||||
|
||||
_noreturn bool __check_failed(const char* file, const char* line, const char* func, const char* expr)
|
||||
{
|
||||
if (!g_check_already_failed)
|
||||
{ // Avoid endlessly failing when trying to report a failed check.
|
||||
g_check_already_failed = true;
|
||||
kerrorln("ERROR: Check failed at %s:%s, in %s: %s", file, line, func, expr);
|
||||
}
|
||||
CPU::efficient_halt();
|
||||
}
|
@ -35,15 +35,3 @@ namespace Serial
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
static bool g_check_already_failed = false;
|
||||
|
||||
_noreturn bool __check_failed(const char* file, const char* line, const char* func, const char* expr)
|
||||
{
|
||||
if (!g_check_already_failed)
|
||||
{ // Avoid endlessly failing when trying to report a failed check.
|
||||
g_check_already_failed = true;
|
||||
Serial::printf("ERROR: Check failed at %s:%s, in %s: %s\n", file, line, func, expr);
|
||||
}
|
||||
CPU::efficient_halt();
|
||||
}
|
Loading…
Reference in New Issue
Block a user