Skip to content

Commit

Permalink
esp32: 9 LED pins with audioreactive
Browse files Browse the repository at this point in the history
this allows to use 9 (instead of 8) LED pins on esp32.
  • Loading branch information
softhack007 committed Sep 22, 2023
1 parent 7425b43 commit 015ce11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 3 additions & 2 deletions wled00/bus_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -1177,10 +1177,11 @@ 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
#ifndef WLEDMM_FASTPATH
if (num > 9) return I_NONE;
if (num > 7) offset = num -7;
if (num == 8) offset = 2; // first use I2S#1 (so #0 stays available for audio)
if (num == 9) offset = 1; // use I2S#0 as the last driver
#else
// ESP32 "audio_fastpath" - 8 RMT and 1 I2S channels. RMT 5-8 have sending delays, so use I2S#1 before going for RMT 5-8
if (num > 8) return I_NONE;
Expand Down
7 changes: 1 addition & 6 deletions wled00/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,8 @@
#define WLED_MIN_VIRTUAL_BUSSES 4
#else
#if defined(USERMOD_AUDIOREACTIVE) // requested by @softhack007 https://github.com/blazoncek/WLED/issues/33
#ifndef WLEDMM_FASTPATH
#define WLED_MAX_BUSSES 8
#define WLED_MIN_VIRTUAL_BUSSES 2
#else
#define WLED_MAX_BUSSES 9 // WLEDMM I2S#1 is availeable for LEDs
#define WLED_MAX_BUSSES 9 // WLEDMM I2S#1 is availeable for LEDs
#define WLED_MIN_VIRTUAL_BUSSES 1
#endif
#else
#define WLED_MAX_BUSSES 10
#define WLED_MIN_VIRTUAL_BUSSES 0
Expand Down

0 comments on commit 015ce11

Please sign in to comment.