Add debug_log, fix tx_bht (#1149)

This commit is contained in:
Kyle Reed 2023-06-12 23:14:26 -07:00 committed by GitHub
parent 3db2053c21
commit 19491ce3f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 24 deletions

View file

@ -26,12 +26,26 @@
#include <hal.h>
#include <string>
#include "log_file.hpp"
#include "portapack.hpp"
#include "string_format.hpp"
#include "ui_styles.hpp"
using namespace ui;
#define DEBUG_LOG_FILE "debug_log.txt"
LogFile* pg_debug_log = nullptr;
void __debug_log(const std::string& msg) {
static LogFile s_log;
if (pg_debug_log == nullptr) {
delete_file(DEBUG_LOG_FILE);
s_log.append(DEBUG_LOG_FILE);
pg_debug_log = &s_log;
}
pg_debug_log->write_entry(msg);
}
void runtime_error(LED);
std::string number_to_hex_string(uint32_t);
void draw_line(int32_t, const char*, regarm_t);