oled printf

This commit is contained in:
2020-11-19 20:40:30 +01:00
parent 33fcf6c080
commit b122d836ed
3 changed files with 15 additions and 3 deletions

View File

@ -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);
}