fastpath: use i2s#1 for 5th LED pin

use 4 RMT channels, then I2S#1, then RMT 5-8. This allows to have up to 5 "fast" LED pins.

"Even though the ESP32 has 8 channels of RMT hardware, using beyond 4 has shown to cause sending delays." (https://github.com/Makuna/NeoPixelBus/wiki/ESP32-NeoMethods#rmt)
This commit is contained in:
Frank
2023-05-03 00:29:14 +02:00
parent 56b6290fdd
commit 91d36fa269
3 changed files with 22 additions and 2 deletions

View File

@@ -928,9 +928,15 @@ class PolyBus {
if (num > 3) return I_NONE;
//if (num > 3) offset = num -4; // I2S not supported yet
#else
#ifndef WLEDMM_FASTPATH
// standard ESP32 has 8 RMT and 2 I2S channels
if (num > 9) return I_NONE;
if (num > 7) offset = num -7;
#else
// ESP32 "audio_fastpath" - 8 RMT and 1 I2S channels. RMT 5-8 have sending delays, so use I2S#1 as 5th bus, before going for RMT 5-8
if (num > 8) return I_NONE;
if (num == 4) offset = 2; // use I2S channel 2 as 5th bus. Ladies and Gentlemen, _this_ is a dirty hack.
#endif
#endif
switch (busType) {
case TYPE_WS2812_1CH_X3: