From 51dc5b6e89882142752daa8c4aa668a820d8fc1d Mon Sep 17 00:00:00 2001 From: wuhanstudio Date: Wed, 6 Oct 2021 09:11:30 +0100 Subject: [PATCH] Use the same U8g2lib.cpp and U8x8lib.cpp for different ports --- sys/arm-linux/port/U8g2lib.cpp | 4 +++- sys/arm-linux/port/U8x8lib.cpp | 1 + sys/rt-thread/port/U8g2lib.cpp | 4 +++- sys/rt-thread/port/U8x8lib.cpp | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/arm-linux/port/U8g2lib.cpp b/sys/arm-linux/port/U8g2lib.cpp index 8d61cd9c..e50e9b82 100644 --- a/sys/arm-linux/port/U8g2lib.cpp +++ b/sys/arm-linux/port/U8g2lib.cpp @@ -44,7 +44,9 @@ static Print *u8g2_print_for_screenshot; void u8g2_print_callback(const char *s) { - // yield(); +#ifdef ARDUINO + yield(); +#endif u8g2_print_for_screenshot->print(s); } diff --git a/sys/arm-linux/port/U8x8lib.cpp b/sys/arm-linux/port/U8x8lib.cpp index db3f9460..7f9d0253 100644 --- a/sys/arm-linux/port/U8x8lib.cpp +++ b/sys/arm-linux/port/U8x8lib.cpp @@ -1650,6 +1650,7 @@ extern "C" uint8_t u8x8_byte_arduino_ks0108(u8x8_t *u8x8, uint8_t msg, uint8_t a + #ifdef U8X8_USE_PINS /* diff --git a/sys/rt-thread/port/U8g2lib.cpp b/sys/rt-thread/port/U8g2lib.cpp index 83f9307e..e50e9b82 100644 --- a/sys/rt-thread/port/U8g2lib.cpp +++ b/sys/rt-thread/port/U8g2lib.cpp @@ -44,7 +44,9 @@ static Print *u8g2_print_for_screenshot; void u8g2_print_callback(const char *s) { -// yield(); +#ifdef ARDUINO + yield(); +#endif u8g2_print_for_screenshot->print(s); } diff --git a/sys/rt-thread/port/U8x8lib.cpp b/sys/rt-thread/port/U8x8lib.cpp index 7fcfb5c6..7f9d0253 100644 --- a/sys/rt-thread/port/U8x8lib.cpp +++ b/sys/rt-thread/port/U8x8lib.cpp @@ -49,6 +49,7 @@ #endif + /*=============================================*/ size_t U8X8::write(uint8_t v) @@ -1641,8 +1642,9 @@ extern "C" uint8_t u8x8_byte_arduino_ks0108(u8x8_t *u8x8, uint8_t msg, uint8_t a } #endif +#endif /*ARDUINO*/ + -#endif