BAN::Formatter now takes putc like function as a parameter
This allows us to use capturing lambdas as a putc like function
This commit is contained in:
@@ -5,22 +5,22 @@
|
||||
|
||||
#define dprintln(...) \
|
||||
do { \
|
||||
BAN::Formatter::print<Serial::serial_putc>("[{5.3}] {}({}): ", (float)PIT::ms_since_boot() / 1000.0f, __FILE__, __LINE__); \
|
||||
BAN::Formatter::println<Serial::serial_putc>(__VA_ARGS__); \
|
||||
BAN::Formatter::print(Serial::serial_putc, "[{5.3}] {}({}): ", (float)PIT::ms_since_boot() / 1000.0f, __FILE__, __LINE__); \
|
||||
BAN::Formatter::println(Serial::serial_putc, __VA_ARGS__); \
|
||||
} while(false)
|
||||
|
||||
#define dwarnln(...) \
|
||||
do { \
|
||||
BAN::Formatter::print<Serial::serial_putc>("\e[33m"); \
|
||||
BAN::Formatter::print(Serial::serial_putc, "\e[33m"); \
|
||||
dprintln(__VA_ARGS__); \
|
||||
BAN::Formatter::print<Serial::serial_putc>("\e[m"); \
|
||||
BAN::Formatter::print(Serial::serial_putc, "\e[m"); \
|
||||
} while(false)
|
||||
|
||||
#define derrorln(...) \
|
||||
do { \
|
||||
BAN::Formatter::print<Serial::serial_putc>("\e[31m"); \
|
||||
BAN::Formatter::print(Serial::serial_putc, "\e[31m"); \
|
||||
dprintln(__VA_ARGS__); \
|
||||
BAN::Formatter::print<Serial::serial_putc>("\e[m"); \
|
||||
BAN::Formatter::print(Serial::serial_putc, "\e[m"); \
|
||||
} while(false)
|
||||
|
||||
namespace Serial
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
#include <BAN/Formatter.h>
|
||||
#include <kernel/TTY.h>
|
||||
|
||||
#define kprint(...) BAN::Formatter::print<TTY::PutCharCurrent>(__VA_ARGS__)
|
||||
#define kprintln(...) BAN::Formatter::println<TTY::PutCharCurrent>(__VA_ARGS__)
|
||||
#define kprint(...) BAN::Formatter::print(TTY::PutCharCurrent, __VA_ARGS__)
|
||||
#define kprintln(...) BAN::Formatter::println(TTY::PutCharCurrent, __VA_ARGS__)
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Kernel
|
||||
for (size_t i = 2; i < arguments.Size(); i++)
|
||||
kprint(" {}", arguments[i]);
|
||||
}
|
||||
kprintln();
|
||||
kprintln("");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Kernel
|
||||
if (edx & ((uint32_t)1 << i))
|
||||
kprint("{}{}", first ? (first = false, "") : ", ", CPUID::FeatStringEDX((uint32_t)1 << i));
|
||||
if (!first)
|
||||
kprintln();
|
||||
kprintln("");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user