Change debug::puts to use string_view instead of const char*
This commit is contained in:
parent
e8fbb60691
commit
da4816dcc3
@ -2,6 +2,8 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <mtl/string_view.hpp>
|
||||
|
||||
namespace debug {
|
||||
enum level {
|
||||
fatal = 0,
|
||||
@ -11,7 +13,7 @@ enum level {
|
||||
debug = 4,
|
||||
};
|
||||
|
||||
void puts(const char* msg, level lvl = level::info );
|
||||
void puts(const mtl::string_view& msg, level lvl = level::info );
|
||||
|
||||
bool open();
|
||||
void close();
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
#include <tonc.h>
|
||||
|
||||
#include <mtl/string.hpp>
|
||||
#include <mtl/string_view.hpp>
|
||||
|
||||
namespace debug {
|
||||
/**
|
||||
@ -33,10 +34,9 @@ static volatile uint16_t& flags = *reinterpret_cast<uint16_t*>(0x4FFF700);
|
||||
static mtl::string_ext string(reinterpret_cast<char*>(0x4FFF600), 256);
|
||||
}; // namespace reg
|
||||
|
||||
|
||||
void puts(const char* msg, level lvl) {
|
||||
void puts(const mtl::string_view& msg, level lvl) {
|
||||
reg::string = msg;
|
||||
reg::flags = (lvl) | 0x100;
|
||||
reg::flags = lvl | 0x100;
|
||||
}
|
||||
|
||||
bool open() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user