From 6d7b392620c1e7acff54a0e90425b18c9fcb64df Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 21 Dec 2019 16:51:09 +0100 Subject: [PATCH] ss_oled update (now working) --- platformio.ini | 3 ++- src/display.cpp | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platformio.ini b/platformio.ini index 7415024d..0a7fac3f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -58,7 +58,8 @@ lib_deps_lora = ;MCCI LoRaWAN LMIC library@>=3.0.99 ; MCCI LMIC by Terrill Moore https://github.com/mcci-catena/arduino-lmic.git#5322dd1 lib_deps_display = - ss_oled@=3.1.0 + ;ss_oled@=3.1.0 + https://github.com/bitbank2/ss_oled.git#a5fbee4 BitBang_I2C@>=1.2.0 QRCode@>=0.0.1 lib_deps_matrix_display = diff --git a/src/display.cpp b/src/display.cpp index b9bed14c..3262f290 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -57,6 +57,7 @@ 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}; +static uint8_t plotbuf[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8] = {0}; QRCode qrcode; @@ -298,7 +299,7 @@ void draw_page(time_t t, uint8_t page) { // page 1: pax graph case 1: - oledDumpBuffer(displaybuf); + oledDumpBuffer(plotbuf); break; // page1 // page 2: GPS @@ -502,24 +503,22 @@ void oledPlotCurve(uint16_t count, bool reset) { if (col < DISPLAY_WIDTH - 1) // matrix not full -> increment column col++; else // matrix full -> scroll left 1 dot - oledScrollBufferHorizontal(displaybuf, DISPLAY_WIDTH, DISPLAY_HEIGHT, - true); + oledScrollBufferHorizontal(plotbuf, DISPLAY_WIDTH, DISPLAY_HEIGHT, true); } else // clear current dot - oledDrawPixel(displaybuf, col, row, 0); + oledDrawPixel(plotbuf, col, row, 0); // scroll down, if necessary while ((count - v_scroll) > DISPLAY_HEIGHT - 1) v_scroll++; if (v_scroll) - oledScrollBufferVertical(displaybuf, DISPLAY_WIDTH, DISPLAY_HEIGHT, - v_scroll); + oledScrollBufferVertical(plotbuf, DISPLAY_WIDTH, DISPLAY_HEIGHT, v_scroll); // set new dot // row = DISPLAY_HEIGHT - 1 - (count - v_scroll) % DISPLAY_HEIGHT; row = DISPLAY_HEIGHT - 1 - count - v_scroll; last_count = count; - oledDrawPixel(displaybuf, col, row, 1); + oledDrawPixel(plotbuf, col, row, 1); } #endif // HAS_DISPLAY \ No newline at end of file