kernel/uart: Refactor code

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2024-12-23 03:52:26 +02:00
parent 0807ea5a9a
commit 81af8a48cb
10 changed files with 102 additions and 249 deletions

View File

@ -25,14 +25,11 @@ bool EnableProfiler = false;
bool Wait = false;
unsigned long long LogDepth = 0;
unsigned int Level = 0;
using namespace UniversalAsynchronousReceiverTransmitter;
UART com2(COM2);
static inline nsa NIF void profiler_uart_wrapper(char c, void *unused)
{
bool renable = EnableProfiler;
EnableProfiler = false;
com2.Write(c);
UNUSED(unused);
if (renable)
EnableProfiler = true;

View File

@ -21,8 +21,6 @@
#include "../kernel.h"
using namespace UniversalAsynchronousReceiverTransmitter;
#if BITS_PER_LONG >= 64
typedef long gcov_type;
#else
@ -57,7 +55,7 @@ struct gcov_info
static inline nsa NIF void gcov_uart_wrapper(char c, void *unused)
{
UART(COM2).Write(c);
UNUSED(c);
UNUSED(unused);
}

View File

@ -21,11 +21,9 @@
#include "../kernel.h"
using namespace UniversalAsynchronousReceiverTransmitter;
static inline nsa NIF void gprof_uart_wrapper(char c, void *unused)
{
UART(COM2).Write(c);
UNUSED(c);
UNUSED(unused);
}