From 0e64e0d7a73d7f37a3cd030c9b3bc7966341667c Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Sun, 12 Mar 2023 09:49:16 +0000 Subject: [PATCH] Fix arduino compile issue introduced in commit f970b78 --- src/ESP32-HUB75-MatrixPanel-I2S-DMA.h | 40 ++++++++++++++------------ src/ESP32-VirtualMatrixPanel-I2S-DMA.h | 2 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h index 863a1b0..9e7ed4e 100644 --- a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h +++ b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h @@ -238,37 +238,35 @@ struct HUB75_I2S_CFG { */ enum clk_speed {HZ_8M=8000000, HZ_10M=10000000, HZ_15M=15000000, HZ_20M=20000000}; - // Structure Variables - /** - * GPIO pins mapping - */ - struct i2s_pins{ - int8_t r1, g1, b1, r2, g2, b2, a, b, c, d, e, lat, oe, clk; - } gpio; - - // Matrix driver chip type - default is a plain shift register - shift_driver driver; - // I2S clock speed - clk_speed i2sspeed; + // + // Members must be in order of declaration or it breaks Arduino compiling due to strict checking. + // // physical width of a single matrix panel module (in pixels, usually it is 64 ;) ) uint16_t mx_width; + // physical height of a single matrix panel module (in pixels, usually almost always it is either 32 or 64) uint16_t mx_height; + // number of chained panels regardless of the topology, default 1 - a single matrix module uint16_t chain_length; + + // GPIO Mapping + struct i2s_pins{ int8_t r1, g1, b1, r2, g2, b2, a, b, c, d, e, lat, oe, clk; } gpio; - // Minimum refresh / scan rate needs to be configured on start due to LSBMSB_TRANSITION_BIT calculation in allocateDMAmemory() - uint16_t min_refresh_rate; - - // How many clock cycles to blank OE before/after LAT signal change, default is 1 clock - uint8_t latch_blanking; + // Matrix driver chip type - default is a plain shift register + shift_driver driver; // use DMA double buffer (twice as much RAM required) bool double_buff; + + // I2S clock speed + clk_speed i2sspeed; - + // How many clock cycles to blank OE before/after LAT signal change, default is 1 clock + uint8_t latch_blanking; + /** * I2S clock phase * 0 - data lines are clocked with negative edge @@ -285,6 +283,10 @@ struct HUB75_I2S_CFG { */ bool clkphase; + // Minimum refresh / scan rate needs to be configured on start due to LSBMSB_TRANSITION_BIT calculation in allocateDMAmemory() + uint8_t min_refresh_rate; + + // struct constructor HUB75_I2S_CFG ( uint16_t _w = MATRIX_WIDTH, @@ -306,8 +308,8 @@ struct HUB75_I2S_CFG { chain_length(_chain), gpio(_pinmap), driver(_drv), - i2sspeed(_i2sspeed), double_buff(_dbuff), + i2sspeed(_i2sspeed), latch_blanking(_latblk), clkphase(_clockphase), min_refresh_rate(_min_refresh_rate) diff --git a/src/ESP32-VirtualMatrixPanel-I2S-DMA.h b/src/ESP32-VirtualMatrixPanel-I2S-DMA.h index 1f29a30..06d5f0a 100644 --- a/src/ESP32-VirtualMatrixPanel-I2S-DMA.h +++ b/src/ESP32-VirtualMatrixPanel-I2S-DMA.h @@ -30,7 +30,7 @@ #include #endif -#include +//#include struct VirtualCoords {