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