Rewrite logging system and sync state with clients
This commit is contained in:
30
src/common.c
30
src/common.c
@@ -1 +1,29 @@
|
||||
void *TODO;
|
||||
#include "common.h"
|
||||
#include "serial.h"
|
||||
|
||||
#define PREFIX_ERROR(fmt) "Error:" fmt
|
||||
|
||||
static bool state;
|
||||
|
||||
void Info(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
USART_Print(state, "", fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void Error(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
USART_Print(state, "Error: ", fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void SetStateFlag(bool is_running)
|
||||
{
|
||||
state = is_running;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user