Add #ifdefs to make C++ interface usable without Arduino.

This commit is contained in:
Petteri Aimonen
2022-01-10 20:40:29 +02:00
parent 86bcb89893
commit dbe0304223
3 changed files with 25 additions and 8 deletions
+2 -4
View File
@@ -39,14 +39,12 @@
#include "U8g2lib.h"
#ifdef ARDUINO
static Print *u8g2_print_for_screenshot;
void u8g2_print_callback(const char *s)
{
#ifdef ARDUINO
yield();
#endif
u8g2_print_for_screenshot->print(s);
}
@@ -73,6 +71,6 @@ void U8G2::writeBufferXBM2(Print &p)
u8g2_print_for_screenshot = &p;
u8g2_WriteBufferXBM2(getU8g2(), u8g2_print_callback);
}
#endif