It’s just a reminder.
If matrix panels drived by FM612X chip, the library has slow setup process because of SMARTMATRIX_OPTIONS_FM6126A_RESET_AT_START
. In my case with 14 panels (32x16, 4 scan mode), begin()
calling costs 7000+ms.
Look into the function
void SmartMatrix3RefreshMultiplexed<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::begin(uint32_t dmaRamToKeepFreeBytes)
where there are many delay(1)
calling in two loops., such as:
// Send Data to control register 11
for(int i=0; i<PIXELS_PER_LATCH; i++) {
int y=i%16;
gpio_set_level(R1_PIN, 0);
gpio_set_level(G1_PIN, 0);
gpio_set_level(B1_PIN, 0);
gpio_set_level(R2_PIN, 0);
gpio_set_level(G2_PIN, 0);
gpio_set_level(B2_PIN, 0);
if(C12[y] == 1) {
gpio_set_level(R1_PIN, 1);
gpio_set_level(G1_PIN, 1);
gpio_set_level(B1_PIN, 1);
gpio_set_level(R2_PIN, 1);
gpio_set_level(G2_PIN, 1);
gpio_set_level(B2_PIN, 1);
}
delay(1);
if(i > PIXELS_PER_LATCH-12)
gpio_set_level(LAT_PIN, 1);
else
gpio_set_level(LAT_PIN, 0);
delay(1);
#ifdef CLK_MANUAL_PIN
gpio_set_level(CLK_MANUAL_PIN, 1);
gpio_set_level(CLK_MANUAL_PIN, 0);
#endif
gpio_set_level(CLK_PIN, 1);
delay(1);
gpio_set_level(CLK_PIN, 0);
delay(1);
}
So, when you have a bigger matrix, you suffer a long loop for PIXELS_PER_LATCH
for this macro.
#define PIXELS_PER_LATCH ((matrixWidth * matrixHeight) / MATRIX_PANEL_HEIGHT * PHYSICAL_ROWS_PER_REFRESH_ROW)
That is, to comment out delay(1);
will improve performance at the beginning.