diff --git a/ESP32-RGB64x32MatrixPanel-I2S-DMA.cpp b/ESP32-RGB64x32MatrixPanel-I2S-DMA.cpp index 4d05360..bd90c88 100644 --- a/ESP32-RGB64x32MatrixPanel-I2S-DMA.cpp +++ b/ESP32-RGB64x32MatrixPanel-I2S-DMA.cpp @@ -52,6 +52,18 @@ */ + +// For development testing only +//#define IGNORE_REFRESH_RATE 1 + + + +uint8_t val2PWM(int val) { + if (val<0) val=0; + if (val>255) val=255; + return lumConvTab[val]; +} + bool RGB64x32MatrixPanel_I2S_DMA::allocateDMAmemory() { @@ -142,15 +154,18 @@ bool RGB64x32MatrixPanel_I2S_DMA::allocateDMAmemory() * Step 2: Calculate the amount of memory required for the DMA engine's linked list descriptors. * Credit to SmartMatrix for this stuff. */ + // Calculate what color depth is actually possible based on memory avaialble vs. required dma linked-list descriptors. // aka. Calculate the lowest LSBMSB_TRANSITION_BIT value that will fit in memory int numDMAdescriptorsPerRow = 0; lsbMsbTransitionBit = 0; + + #ifndef IGNORE_REFRESH_RATE while(1) { numDMAdescriptorsPerRow = 1; for(int i=lsbMsbTransitionBit + 1; i