From ed792f75b299c2b3dbe82f3cccc43803df9e9716 Mon Sep 17 00:00:00 2001 From: Thomas Ballmann Date: Sun, 16 Feb 2020 17:35:35 +0100 Subject: [PATCH] bugfix with wbmp --- src/cloud.cpp | 24 ------------------------ src/display.cpp | 2 +- src/imageWBMP.cpp | 6 ++++-- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/src/cloud.cpp b/src/cloud.cpp index f4eabe7..5299e55 100644 --- a/src/cloud.cpp +++ b/src/cloud.cpp @@ -185,30 +185,6 @@ void requestCloud() // write display frame wbmpWriteFramebuffer(imageBufferOffset, buff, c); imageBufferOffset += c; - /* - for (int i = 0; i < c; i++) - { - // write to display buffer - displayImageBuffer[imageBufferOffset] = buff[i]; - imageBufferOffset++; - - // update display if image buffer is full - if (imageBufferOffset == FRAME_BUFFERBUFFE_SIZE) - { - // TODO update display? - Serial.printf("TODO update display"); - - // update... - updateDisplay_Neu(displayImageBuffer); - - // reset image buffer - memset(displayImageBuffer, 0, sizeof(displayImageBuffer)); - imageBufferOffset = 0; - - break; - } - } - */ if (len > 0) { diff --git a/src/display.cpp b/src/display.cpp index 3a7b3d0..88ef84e 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -45,7 +45,7 @@ void displayWriteFramebuffer(uint8_t bitmap[]) void displayFlush() { - Serial.println("displayFlushFramebuffer"); + Serial.println("displayFlush"); display.nextPage(); } diff --git a/src/imageWBMP.cpp b/src/imageWBMP.cpp index 7432d9a..8b4a258 100644 --- a/src/imageWBMP.cpp +++ b/src/imageWBMP.cpp @@ -14,6 +14,8 @@ void setupImageWBMP() void wbmpOpenFramebuffer() { + Serial.println("wbmpOpenFramebuffer"); + displayOpen(); memset(_buffer, 0, sizeof(_buffer)); } @@ -21,10 +23,10 @@ void wbmpOpenFramebuffer() // TODO do it better :-) void wbmpWriteFramebuffer(int offset, uint8_t bitmap[], int c) { + Serial.println("wbmpWriteFramebuffer"); for (int i = 0; i < c; i++) { - _buffer[offset] = bitmap[i]; - offset++; + _buffer[offset + i] = bitmap[i]; } /*