Implement dbg log interface

This commit is contained in:
TuxSH
2018-03-06 01:29:06 +01:00
parent a65d380889
commit d2b1febb43
11 changed files with 471 additions and 1 deletions

25
exosphere/src/dbg/log.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef EXOSPHERE_DBG_LOG_H
#define EXOSPHERE_DBG_LOG_H
#include "../utils.h"
#define DBG_LOG_BUF_SIZE 256
typedef enum {
DEBUGLOGDEVICE_NULL = 0,
DEBUGLOGDEVICE_UART = 1,
DEBUGLOGDEVICE_MAX = 2,
} DebugLogDevice;
typedef struct debug_log_device_t {
void (*initialize)(struct debug_log_device_t *this, ...);
void (*write_string)(struct debug_log_device_t *this, const char *str, size_t len);
void (*finalize)(struct debug_log_device_t *this);
} debug_log_device_t;
void dbg_log_initialize(DebugLogDevice device);
void dbg_log_write(const char *fmt, ...);
void dbg_log_finalize(void);
#endif