diff options
-rw-r--r-- | lcdprint.cpp | 3 | ||||
-rw-r--r-- | lcdprint.h | 2 | ||||
-rw-r--r-- | utf8.cpp | 5 | ||||
-rw-r--r-- | utf8.h | 1 |
4 files changed, 9 insertions, 2 deletions
diff --git a/lcdprint.cpp b/lcdprint.cpp index 7fa432d..8de92b3 100644 --- a/lcdprint.cpp +++ b/lcdprint.cpp @@ -21,11 +21,12 @@ #include "lcdprint.h" #include "font.h" -size_t uprint(utf8 str, LiquidCrystal *lcd) +size_t uprint(char* rawstr, LiquidCrystal *lcd) { int32_t ucode; int i, j; int numcodes = sizeof(charmap)/sizeof(charcode); + utf8 str = utf8(rawstr); char result[str.chars]; for (i = 0; i < str.chars; i++) { @@ -22,6 +22,6 @@ #include "utf8.h" -size_t uprint (utf8, LiquidCrystal*); +size_t uprint (char*, LiquidCrystal*); #endif @@ -42,6 +42,11 @@ utf8::utf8 (char* input) _index = 0; } +utf8::~utf8 () +{ + free(string); +} + int32_t utf8::get() { int32_t code; @@ -25,6 +25,7 @@ class utf8 { public: utf8(char* string); + ~utf8(void); uint16_t chars; uint16_t bytes; int32_t get(); |