Change debug::puts to use string_view instead of const char*

This commit is contained in:
Madeline Busig 2024-03-07 14:27:44 -07:00
parent 2f8eb0775f
commit 6a6a114fed
2 changed files with 6 additions and 4 deletions

View File

@ -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();

View File

@ -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() {