UART write example (#53)
* Rename test functions * rewrite furi API, segfault * make fixes in FURI, log through FURI * add uart write example blank * implement fuprintf instead of fopencookie * add gif, blank page * UART write example description Co-authored-by: Vadim Kaushan <admin@disasm.info>
This commit is contained in:
25
core/log.c
Normal file
25
core/log.c
Normal file
@@ -0,0 +1,25 @@
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "furi.h"
|
||||
|
||||
#define PRINT_STR_SIZE 64
|
||||
|
||||
void fuprintf(FuriRecordSubscriber* f, const char * format, ...) {
|
||||
char buffer[PRINT_STR_SIZE];
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vsprintf(buffer, format, args);
|
||||
va_end(args);
|
||||
|
||||
furi_write(f, buffer, strlen(buffer));
|
||||
}
|
||||
|
||||
FuriRecordSubscriber* get_default_log() {
|
||||
return furi_open("tty", false, false, NULL, NULL);
|
||||
}
|
||||
Reference in New Issue
Block a user