diff options
| author | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-12-21 22:19:59 +0000 |
|---|---|---|
| committer | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-12-21 22:19:59 +0000 |
| commit | 4f5fcf039953cbfbae689f9a433c8f9cd36348c8 (patch) | |
| tree | 561ce38c5656e488cfaaf867d7f64ddf6082b48e /ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | |
| parent | 229b0d874c5370fe4b50988dd9a17ff8248068ed (diff) | |
Christmas DMA core tweaks
Bring back support to change the I2S_NUM_X as a define.
Attempt to reduce buffer swap flicker with some additional checks.
Diffstat (limited to 'ESP32-HUB75-MatrixPanel-I2S-DMA.cpp')
| -rw-r--r-- | ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index a82b37f..a9fae2f 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -419,7 +419,7 @@ void MatrixPanel_I2S_DMA::configureDMA(const HUB75_I2S_CFG& _cfg) Serial.println(F("Performing I2S setup:")); #endif - i2s_parallel_config_t cfg = { + i2s_parallel_config_t dma_cfg = { .gpio_bus={_cfg.gpio.r1, _cfg.gpio.g1, _cfg.gpio.b1, _cfg.gpio.r2, _cfg.gpio.g2, _cfg.gpio.b2, _cfg.gpio.lat, _cfg.gpio.oe, _cfg.gpio.a, _cfg.gpio.b, _cfg.gpio.c, _cfg.gpio.d, _cfg.gpio.e, -1, -1, -1}, .gpio_clk=_cfg.gpio.clk, .sample_rate=_cfg.i2sspeed, @@ -428,18 +428,16 @@ void MatrixPanel_I2S_DMA::configureDMA(const HUB75_I2S_CFG& _cfg) .lldesc_a=dmadesc_a, .desccount_b=desccount, .lldesc_b=dmadesc_b, - .clkphase=_cfg.clkphase + .clkphase=_cfg.clkphase, + .int_ena_out_eof=_cfg.double_buff }; - - // Setup I2S - i2s_parallel_driver_install(I2S_NUM_0, &cfg); - //i2s_parallel_setup_without_malloc(&I2S1, &cfg); - - // Start DMA Output - i2s_parallel_send_dma(I2S_NUM_0, &dmadesc_a[0]); + + // Setup I2S + i2s_parallel_driver_install(ESP32_I2S_DEVICE, &dma_cfg); + i2s_parallel_send_dma(ESP32_I2S_DEVICE, &dmadesc_a[0]); #if SERIAL_DEBUG - Serial.println(F("configureDMA(): DMA setup completed on I2S_NUM_0.")); + Serial.println(F("configureDMA(): DMA setup completed on ESP32_I2S_DEVICE.")); #endif } // end initMatrixDMABuff |
