Skip to content

Commit 6daa47b

Browse files
author
Louis Beaudoin
committed
GifMemory example - rename patternsList to gifsList
1 parent b6a5297 commit 6daa47b

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

examples/SmartMatrixGifMemory/SmartMatrixGifMemory.ino

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
#include "homer_tiny.h"
9090
#include "badgers.h"
9191

92-
// add pattern name and sizeof(pattern) to the below lists
93-
const uint8_t * patternsList[] = { ucBadgers, homer_tiny };
94-
const uint16_t patternsSizeList[] = { sizeof(ucBadgers), sizeof(homer_tiny) };
92+
// add gif name and sizeof(gif) to the below lists
93+
const uint8_t * gifsList[] = { ucBadgers, homer_tiny };
94+
const uint16_t gifsSizeList[] = { sizeof(ucBadgers), sizeof(homer_tiny) };
9595

9696
#define DISPLAY_TIME_SECONDS 10
9797
#define NUMBER_FULL_CYCLES 100
@@ -130,8 +130,6 @@ SMARTMATRIX_ALLOCATE_SCROLLING_LAYER(scrollingLayer, kMatrixWidth, kMatrixHeight
130130
*/
131131
GifDecoder<kMatrixWidth, kMatrixHeight, 12> decoder;
132132

133-
int num_files;
134-
135133
void screenClearCallback(void) {
136134
#if (USE_SMARTMATRIX == 1)
137135
backgroundLayer.fillScreen({0,0,0});
@@ -226,7 +224,7 @@ void loop() {
226224
playNextGif = false;
227225

228226
// start decoding, skipping to the next GIF if there's an error
229-
if(decoder.startDecoding((uint8_t *)patternsList[index], patternsSizeList[index]) < 0) {
227+
if(decoder.startDecoding((uint8_t *)gifsList[index], gifsSizeList[index]) < 0) {
230228
playNextGif = true;
231229
return;
232230
}
@@ -235,7 +233,7 @@ void loop() {
235233
displayStartTime_millis = now;
236234

237235
// get the index for the next pass through
238-
index = (index+1) % (sizeof(patternsList)/sizeof(patternsList[0]));
236+
index = (index+1) % (sizeof(gifsList)/sizeof(gifsList[0]));
239237
}
240238

241239
// decode frame without delaying after decode

0 commit comments

Comments
 (0)