From c65c32275e01c3ac38544451201ed1dd48b27d9d Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 21 Dec 2019 15:18:42 +0100 Subject: [PATCH] update ss_oled lib (experimental) --- include/display.h | 2 +- platformio.ini | 10 ++++------ src/display.cpp | 10 +++++----- src/ota.cpp | 8 ++++++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/include/display.h b/include/display.h index 8e503ce5..4d280500 100644 --- a/include/display.h +++ b/include/display.h @@ -4,7 +4,7 @@ #include "cyclic.h" #include "qrcode.h" -extern uint8_t DisplayIsOn; +extern uint8_t DisplayIsOn, displaybuf[]; void refreshTheDisplay(bool nextPage = false); void init_display(bool verbose = false); diff --git a/platformio.ini b/platformio.ini index e06eb55f..7415024d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -43,7 +43,7 @@ description = Paxcounter is a device for metering passenger flows in realtime. I [common] ; for release_version use max. 10 chars total, use any decimal format like "a.b.c" -release_version = 1.9.82 +release_version = 1.9.83 ; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running! ; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose debug_level = 3 @@ -55,11 +55,10 @@ platform_espressif32 = espressif32@1.11.1 monitor_speed = 115200 upload_speed = 115200 lib_deps_lora = - ;MCCI LoRaWAN LMIC library@>=3.1.0 + ;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.0.0 - ;https://github.com/bitbank2/ss_oled.git#26f5d40 + ss_oled@=3.1.0 BitBang_I2C@>=1.2.0 QRCode@>=0.0.1 lib_deps_matrix_display = @@ -77,8 +76,7 @@ lib_deps_basic = 76@>=1.2.2 ; #76 Timezone by Jack Christensen 274@>=2.3.3 ; #274 RTC by Michael Miller SimpleButton - https://github.com/lewisxhe/AXP202X_Library.git - ;AXP202X_Library@>=1.0.1 + AXP202X_Library@>=1.1.0 ; AXP202 PMU lib by Lewis He lib_deps_all = ${common.lib_deps_basic} ${common.lib_deps_lora} diff --git a/src/display.cpp b/src/display.cpp index cf9f716e..b9bed14c 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -56,7 +56,7 @@ 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; -static uint8_t displaybuf[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8] = {0}; +uint8_t displaybuf[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8] = {0}; QRCode qrcode; @@ -83,7 +83,7 @@ void init_display(bool verbose) { #endif // set display buffer - //oledSetBackBuffer(displaybuf); + oledSetBackBuffer(displaybuf); // clear display oledSetContrast(DISPLAYCONTRAST); @@ -111,7 +111,7 @@ void init_display(bool verbose) { : "ext."); // give user some time to read or take picture - oledDumpBuffer(NULL); + oledDumpBuffer(displaybuf); delay(2000); oledFill(0x00, 1); #endif // VERBOSE @@ -134,7 +134,7 @@ void init_display(bool verbose) { dp_printf(80, i + 3, FONT_NORMAL, 0, "%4.4s", deveui + i * 4); // give user some time to read or take picture - oledDumpBuffer(NULL); + oledDumpBuffer(displaybuf); delay(8000); oledSetContrast(DISPLAYCONTRAST); oledFill(0x00, 1); @@ -178,7 +178,7 @@ void refreshTheDisplay(bool nextPage) { } draw_page(t, DisplayPage); - oledDumpBuffer(NULL); + oledDumpBuffer(displaybuf); I2C_MUTEX_UNLOCK(); // release i2c bus access diff --git a/src/ota.cpp b/src/ota.cpp index 087b92e7..10938b0d 100644 --- a/src/ota.cpp +++ b/src/ota.cpp @@ -49,6 +49,10 @@ void start_ota_update() { #else oledInit(OLED_128x64, ANGLE_FLIPY, false, -1, -1, 400000L); #endif + + // set display buffer + oledSetBackBuffer(displaybuf); + oledFill(0, 1); dp_printf(0, 0, 0, 1, "SOFTWARE UPDATE"); dp_printf(0, 1, 0, 0, "WiFi connect .."); @@ -56,7 +60,7 @@ void start_ota_update() { dp_printf(0, 3, 0, 0, "Fetching .."); dp_printf(0, 4, 0, 0, "Downloading .."); dp_printf(0, 5, 0, 0, "Rebooting .."); - oledDumpBuffer(NULL); + oledDumpBuffer(displaybuf); #endif ESP_LOGI(TAG, "Starting Wifi OTA update"); @@ -309,7 +313,7 @@ void ota_display(const uint8_t row, const std::string status, dp_printf(0, 7, 0, 0, " "); dp_printf(0, 7, 0, 0, msg.substr(0, 16).c_str()); } - oledDumpBuffer(NULL); + oledDumpBuffer(displaybuf); #endif }