update ss_oled lib (experimental)

This commit is contained in:
Verkehrsrot 2019-12-21 15:18:42 +01:00
parent 12f00a9203
commit c65c32275e
4 changed files with 16 additions and 14 deletions

View File

@ -4,7 +4,7 @@
#include "cyclic.h" #include "cyclic.h"
#include "qrcode.h" #include "qrcode.h"
extern uint8_t DisplayIsOn; extern uint8_t DisplayIsOn, displaybuf[];
void refreshTheDisplay(bool nextPage = false); void refreshTheDisplay(bool nextPage = false);
void init_display(bool verbose = false); void init_display(bool verbose = false);

View File

@ -43,7 +43,7 @@ description = Paxcounter is a device for metering passenger flows in realtime. I
[common] [common]
; for release_version use max. 10 chars total, use any decimal format like "a.b.c" ; 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! ; 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 ; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
debug_level = 3 debug_level = 3
@ -55,11 +55,10 @@ platform_espressif32 = espressif32@1.11.1
monitor_speed = 115200 monitor_speed = 115200
upload_speed = 115200 upload_speed = 115200
lib_deps_lora = 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 https://github.com/mcci-catena/arduino-lmic.git#5322dd1
lib_deps_display = 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 BitBang_I2C@>=1.2.0
QRCode@>=0.0.1 QRCode@>=0.0.1
lib_deps_matrix_display = lib_deps_matrix_display =
@ -77,8 +76,7 @@ lib_deps_basic =
76@>=1.2.2 ; #76 Timezone by Jack Christensen 76@>=1.2.2 ; #76 Timezone by Jack Christensen
274@>=2.3.3 ; #274 RTC by Michael Miller 274@>=2.3.3 ; #274 RTC by Michael Miller
SimpleButton SimpleButton
https://github.com/lewisxhe/AXP202X_Library.git AXP202X_Library@>=1.1.0 ; AXP202 PMU lib by Lewis He
;AXP202X_Library@>=1.0.1
lib_deps_all = lib_deps_all =
${common.lib_deps_basic} ${common.lib_deps_basic}
${common.lib_deps_lora} ${common.lib_deps_lora}

View File

@ -56,7 +56,7 @@ static const char TAG[] = __FILE__;
const char *printmonth[] = {"xxx", "Jan", "Feb", "Mar", "Apr", "May", "Jun", const char *printmonth[] = {"xxx", "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
uint8_t DisplayIsOn = 0; 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; QRCode qrcode;
@ -83,7 +83,7 @@ void init_display(bool verbose) {
#endif #endif
// set display buffer // set display buffer
//oledSetBackBuffer(displaybuf); oledSetBackBuffer(displaybuf);
// clear display // clear display
oledSetContrast(DISPLAYCONTRAST); oledSetContrast(DISPLAYCONTRAST);
@ -111,7 +111,7 @@ void init_display(bool verbose) {
: "ext."); : "ext.");
// give user some time to read or take picture // give user some time to read or take picture
oledDumpBuffer(NULL); oledDumpBuffer(displaybuf);
delay(2000); delay(2000);
oledFill(0x00, 1); oledFill(0x00, 1);
#endif // VERBOSE #endif // VERBOSE
@ -134,7 +134,7 @@ void init_display(bool verbose) {
dp_printf(80, i + 3, FONT_NORMAL, 0, "%4.4s", deveui + i * 4); dp_printf(80, i + 3, FONT_NORMAL, 0, "%4.4s", deveui + i * 4);
// give user some time to read or take picture // give user some time to read or take picture
oledDumpBuffer(NULL); oledDumpBuffer(displaybuf);
delay(8000); delay(8000);
oledSetContrast(DISPLAYCONTRAST); oledSetContrast(DISPLAYCONTRAST);
oledFill(0x00, 1); oledFill(0x00, 1);
@ -178,7 +178,7 @@ void refreshTheDisplay(bool nextPage) {
} }
draw_page(t, DisplayPage); draw_page(t, DisplayPage);
oledDumpBuffer(NULL); oledDumpBuffer(displaybuf);
I2C_MUTEX_UNLOCK(); // release i2c bus access I2C_MUTEX_UNLOCK(); // release i2c bus access

View File

@ -49,6 +49,10 @@ void start_ota_update() {
#else #else
oledInit(OLED_128x64, ANGLE_FLIPY, false, -1, -1, 400000L); oledInit(OLED_128x64, ANGLE_FLIPY, false, -1, -1, 400000L);
#endif #endif
// set display buffer
oledSetBackBuffer(displaybuf);
oledFill(0, 1); oledFill(0, 1);
dp_printf(0, 0, 0, 1, "SOFTWARE UPDATE"); dp_printf(0, 0, 0, 1, "SOFTWARE UPDATE");
dp_printf(0, 1, 0, 0, "WiFi connect .."); 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, 3, 0, 0, "Fetching ..");
dp_printf(0, 4, 0, 0, "Downloading .."); dp_printf(0, 4, 0, 0, "Downloading ..");
dp_printf(0, 5, 0, 0, "Rebooting .."); dp_printf(0, 5, 0, 0, "Rebooting ..");
oledDumpBuffer(NULL); oledDumpBuffer(displaybuf);
#endif #endif
ESP_LOGI(TAG, "Starting Wifi OTA update"); 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, " ");
dp_printf(0, 7, 0, 0, msg.substr(0, 16).c_str()); dp_printf(0, 7, 0, 0, msg.substr(0, 16).c_str());
} }
oledDumpBuffer(NULL); oledDumpBuffer(displaybuf);
#endif #endif
} }