Commit 1988199
Fix parallel I2S DMA buffer estimation (8x multiplier)
Fixed critical bug in I2S memory estimation where parallel I2S wasn't accounting for 8x larger DMA buffer:
**Problem:**
- Parallel I2S uses 8 channels simultaneously (I2S0-I2S7)
- Each channel requires its own DMA buffer
- Total DMA buffer is 8x larger than single I2S mode
- Both UI and firmware were underestimating memory by 8x
**Changes:**
1. **FX_fcn.cpp (firmware estimation):**
- Added 8x multiplier when `hasParallelOutput()` is true
- Applied after calculating base i2sCommonSize
- Only affects parallel I2S mode, single I2S unchanged
2. **settings_leds.htm (UI estimation):**
- Added check for parallel I2S checkbox (`d.Sf.PI.checked`)
- Multiplies DMA buffer size by 8 when parallel mode enabled
- Provides accurate memory estimate to users before saving
**Example Impact:**
- Single I2S with 300 LEDs: ~2.7KB DMA buffer
- Parallel I2S with 300 LEDs: ~21.6KB DMA buffer (8x)
- Without fix: UI showed 2.7KB, firmware allocated 21.6KB → confusion
- With fix: Both correctly show and allocate 21.6KB
**Technical Details:**
- Parallel I2S (X8 methods) drive 8 output pins simultaneously
- Each pin needs independent DMA buffer for timing
- NeoPixelBus library allocates 8 separate buffers internally
- Memory estimation must match actual allocation
**Testing:**
- ✅ Web UI built successfully
- ✅ All 16 npm tests passed
- ✅ No compilation errors
- ✅ Accurate memory estimation for both modes
Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>1 parent 8da802a commit 1988199
2 files changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1234 | 1234 | | |
1235 | 1235 | | |
1236 | 1236 | | |
| 1237 | + | |
| 1238 | + | |
1237 | 1239 | | |
1238 | 1240 | | |
1239 | 1241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
0 commit comments