Minor changes
This commit is contained in:
parent
9dc00e35f1
commit
cf8cb970e9
3 changed files with 34 additions and 29 deletions
|
@ -100,10 +100,11 @@ bool MatrixPanel_I2S_DMA::allocateDMAmemory()
|
|||
|
||||
Serial.println(F("DMA memory blocks available before any malloc's: "));
|
||||
heap_caps_print_heap_info(MALLOC_CAP_DMA);
|
||||
|
||||
Serial.println(F("******************************************************************"));
|
||||
Serial.printf_P(PSTR("We're going to need %d bytes of SRAM just for the frame buffer(s).\r\n"), _frame_buffer_memory_required);
|
||||
Serial.printf_P(PSTR("The total amount of DMA capable SRAM memory is %d bytes.\r\n"), heap_caps_get_free_size(MALLOC_CAP_DMA));
|
||||
Serial.printf_P(PSTR("Largest DMA capable SRAM memory block is %d bytes.\r\n"), heap_caps_get_largest_free_block(MALLOC_CAP_DMA));
|
||||
Serial.println(F("******************************************************************"));
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -67,9 +67,6 @@
|
|||
|
||||
/***************************************************************************************/
|
||||
/* Do not change definitions below unless you pretty sure you know what you are doing! */
|
||||
#ifndef ESP32_I2S_CLOCK_SPEED
|
||||
#define ESP32_I2S_CLOCK_SPEED (10000000UL) // @ 10Mhz
|
||||
#endif
|
||||
|
||||
// RGB Panel Constants / Calculated Values
|
||||
#ifndef MATRIX_ROWS_IN_PARALLEL
|
||||
|
@ -233,7 +230,7 @@ struct HUB75_I2S_CFG {
|
|||
/**
|
||||
* I2S clock speed selector
|
||||
*/
|
||||
enum clk_speed {HZ_10M=10000000, HZ_13340K=13340000, HZ_16M=16000000, HZ_20M=20000000, HZ_26670K=26670000};
|
||||
enum clk_speed {HZ_10M=10000000, HZ_20M=20000000};
|
||||
|
||||
// Structure Variables
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
* for different resolutions / panel chain lengths within the sketch 'setup()'.
|
||||
*
|
||||
*/
|
||||
MatrixPanel_I2S_DMA display(true); // Note the TRUE -> Turns of secondary buffer - "double buffering"!
|
||||
// Double buffering is not enabled by default with the library.
|
||||
|
||||
MatrixPanel_I2S_DMA *display = nullptr;
|
||||
|
||||
const byte row0 = 2+0*10;
|
||||
const byte row1 = 2+1*10;
|
||||
|
@ -26,30 +26,37 @@ void setup()
|
|||
|
||||
Serial.println("...Starting Display");
|
||||
|
||||
display.begin(); // setup display with pins as per defined in the library
|
||||
display.setTextColor(display.color565(128, 128, 128));
|
||||
HUB75_I2S_CFG mxconfig;
|
||||
mxconfig.double_buff = true; // Turn of double buffer
|
||||
|
||||
// OK, now we can create our matrix object
|
||||
display = new MatrixPanel_I2S_DMA(mxconfig);
|
||||
|
||||
|
||||
display->begin(); // setup display with pins as per defined in the library
|
||||
display->setTextColor(display->color565(255, 255, 255));
|
||||
|
||||
|
||||
// Buffer 0 test
|
||||
display.fillScreen(display.color565(128, 0, 0));
|
||||
display.setCursor(3, row0);
|
||||
display.print(F("Buffer 0"));
|
||||
display.setCursor(3, row1);
|
||||
display.print(F(" Buffer 0"));
|
||||
display->fillScreen(display->color565(128, 0, 0));
|
||||
display->setCursor(3, row0);
|
||||
display->print(F("Buffer 0"));
|
||||
display->setCursor(3, row1);
|
||||
display->print(F(" Buffer 0"));
|
||||
Serial.println("Wrote to to Buffer 0");
|
||||
display.showDMABuffer();
|
||||
display->showDMABuffer();
|
||||
delay(1500);
|
||||
|
||||
// Buffer 1 test
|
||||
display.flipDMABuffer();
|
||||
display.fillScreen(display.color565(0, 128, 0)); // shouldn't see this
|
||||
display.setCursor(3, row0);
|
||||
display.print(F("Buffer 1"));
|
||||
display.setCursor(3, row2);
|
||||
display.print(F(" Buffer 1"));
|
||||
display->flipDMABuffer();
|
||||
display->fillScreen(display->color565(0, 128, 0)); // shouldn't see this
|
||||
display->setCursor(3, row0);
|
||||
display->print(F("Buffer 1"));
|
||||
display->setCursor(3, row2);
|
||||
display->print(F(" Buffer 1"));
|
||||
|
||||
Serial.println("Wrote to to Buffer 1");
|
||||
display.showDMABuffer();
|
||||
display->showDMABuffer();
|
||||
delay(1500);
|
||||
|
||||
}
|
||||
|
@ -57,31 +64,31 @@ void setup()
|
|||
void loop() {
|
||||
|
||||
// Flip the back buffer
|
||||
display.flipDMABuffer();
|
||||
display->flipDMABuffer();
|
||||
|
||||
// Write: Set bottow row to black
|
||||
for (int y=20;y<MATRIX_HEIGHT; y++)
|
||||
for (int x=0;x<MATRIX_WIDTH; x++)
|
||||
{
|
||||
display.drawPixelRGB888( x, y, 0, 0, 0);
|
||||
display->drawPixelRGB888( x, y, 0, 0, 0);
|
||||
}
|
||||
|
||||
// Write: Set bottom row to blue (this is what should show)
|
||||
for (int y=20;y<MATRIX_HEIGHT; y++)
|
||||
for (int x=0;x<MATRIX_WIDTH; x++)
|
||||
{
|
||||
display.drawPixelRGB888( x, y, 0, 0, 64);
|
||||
display->drawPixelRGB888( x, y, 0, 0, 64);
|
||||
}
|
||||
|
||||
// Now show this back buffer
|
||||
display.showDMABuffer();
|
||||
display->showDMABuffer();
|
||||
delay(1000);
|
||||
|
||||
// Flip back buffer
|
||||
display.flipDMABuffer();
|
||||
display->flipDMABuffer();
|
||||
|
||||
// Show this buffer
|
||||
display.showDMABuffer();
|
||||
display->showDMABuffer();
|
||||
delay(1000);
|
||||
|
||||
}
|
Loading…
Reference in a new issue