Skip to content

Commit

Permalink
Merge pull request #27 from dylduhamel/fix-jpeg-compile
Browse files Browse the repository at this point in the history
Fixed JPEGDraw, incorrect return type for open in JPEGDEC.h.
  • Loading branch information
witnessmenow authored Feb 3, 2024
2 parents efa19e3 + ad42e22 commit 5381337
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <WiFi.h>
#include <WiFiClientSecure.h>

#define FS_NO_GLOBALS
#include <FS.h>
#include "SPIFFS.h"

Expand Down Expand Up @@ -101,12 +100,15 @@ WiFiClientSecure client;
// This next function will be called during decoding of the jpeg file to
// render each block to the Matrix. If you use a different display
// you will need to adapt this function to suit.
void JPEGDraw(JPEGDRAW *pDraw)
int JPEGDraw(JPEGDRAW *pDraw)
{
// Stop further decoding as image is running off bottom of screen
if ( pDraw->y >= dma_display->height() ) return;
if ( pDraw->y >= dma_display->height() ) return 0;

dma_display->drawRGBBitmap(pDraw->x, pDraw->y, pDraw->pPixels, pDraw->iWidth, pDraw->iHeight);

// Return 1 to decode next block
return 1;
}

void displaySetup() {
Expand Down

0 comments on commit 5381337

Please sign in to comment.