From 860e53a8f73f711d79dadbcf92dda29acb2e9bea Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 12 Nov 2018 07:46:21 +0000 Subject: [PATCH] TFTDisplay::drawString --- tftdisplay.cpp | 8 ++++++++ tftdisplay.h | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tftdisplay.cpp b/tftdisplay.cpp index 786df7c..01cbb80 100644 --- a/tftdisplay.cpp +++ b/tftdisplay.cpp @@ -81,3 +81,11 @@ void TFTDisplay::drawPixel(unsigned x, unsigned y, colour_t col) { espi.drawPixel(x, y, col); #endif } + +void TFTDisplay::drawString(const char *s, unsigned x, unsigned y) { +#if defined(USE_UTFT) + utft.print(s, x, y); +#elif defined(USE_ESPI) + espi.drawString(s, x, y); +#endif +} diff --git a/tftdisplay.h b/tftdisplay.h index a9f9ed3..d319027 100644 --- a/tftdisplay.h +++ b/tftdisplay.h @@ -31,9 +31,10 @@ class TFTDisplay { public: void begin(colour_t bg, colour_t fg, orientation_t o = landscape); void clear(); - void status(const char *); + void status(const char *s); void drawPixel(unsigned x, unsigned y, colour_t col); + void drawString(const char *s, unsigned x, unsigned y); protected: unsigned _bg, _fg, _cx, _cy, _dx, _dy, _oxs;