add Display::statusf()

This commit is contained in:
steve 2023-10-20 13:18:38 +01:00
parent 2c2d8146d2
commit 7c9b978012
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,4 @@
#include <stdarg.h>
#include <stdint.h>
#include "hardware.h"
#include "memory.h"
@ -150,6 +151,15 @@ void Display::status(const char *s) {
#endif
}
void Display::statusf(const char *fmt, ...) {
va_list args;
char buf[80];
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
status(buf);
}
void Display::drawPixel(unsigned x, unsigned y, colour_t col) {
x += _xoff;
y += _yoff;

View File

@ -34,6 +34,7 @@ public:
void clear();
void status(const char *s);
void statusf(const char *fmt, ...);
void drawPixel(unsigned x, unsigned y, colour_t col);
void drawString(const char *s, unsigned x, unsigned y);