diff --git a/platformio.ini b/platformio.ini index e22ee581..894149ce 100644 --- a/platformio.ini +++ b/platformio.ini @@ -58,7 +58,8 @@ lib_deps_lora = ;MCCI LoRaWAN LMIC library@>=3.1.0 https://github.com/mcci-catena/arduino-lmic.git#5322dd1 lib_deps_display = - ss_oled@=3.0.0 + ;ss_oled@>=3.1.0 + https://github.com/bitbank2/ss_oled.git#26f5d40 BitBang_I2C@>=1.2.0 QRCode@>=0.0.1 lib_deps_matrix_display = diff --git a/src/display.cpp b/src/display.cpp index 2ac23091..94a11f96 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -56,7 +56,12 @@ static const char TAG[] = __FILE__; const char *printmonth[] = {"xxx", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; uint8_t DisplayIsOn = 0; -uint8_t displaybuf[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8] = {0}; + +#ifdef USE_BACKBUFFER +static uint8_t displaybuf[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8] = {0}; +#else +static uint8_t *displaybuf = NULL; +#endif QRCode qrcode; @@ -82,6 +87,9 @@ void init_display(bool verbose) { oledInit(OLED_128x64, true, false, -1, -1, 400000L); #endif + // set display buffer + oledSetBackBuffer(displaybuf); + // clear display oledSetContrast(DISPLAYCONTRAST); oledFill(0, 1);