oled printf
This commit is contained in:
@ -9,6 +9,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <oled.h>
|
||||
#include <oled-fonts.h>
|
||||
@ -561,4 +563,14 @@ void oledPrint(char msg[]) {
|
||||
lines[MAX_LINES - 1][MAX_CHARS - 1] = 0;
|
||||
oled_P6x8Str(1, MAX_LINES - 1, lines[MAX_LINES - 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void oledPrintf(const char *format, ...) {
|
||||
va_list vl;
|
||||
va_start(vl, format);
|
||||
char buf[MAX_CHARS+1];
|
||||
vsnprintf(buf, MAX_CHARS, format, vl);
|
||||
va_end(vl);
|
||||
oledPrint(buf);
|
||||
}
|
||||
|
Reference in New Issue
Block a user