forked from theelims/ESP32-sveltekit
-
-
Notifications
You must be signed in to change notification settings - Fork 9
71 preps #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
71 preps #104
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fd48e57
Add support for uint32_t controls
ewowi 1b593ea
Monitor: fix scaling and aligning + VUMeter fix
ewowi cfc8213
Give the P4 parlio driver the maximum amount of leds per pin
ewowi 1d09d04
P4 parlio: support for different leds per pin, isRGBW -> nr of channels
ewowi e713e82
mutex optimizations (save heap)
ewowi 6268589
Revert swapMutex back to SemaphoreHandle_t, give updateMutex
ewowi 2d9f90c
updateMutex static, _moduleName char
ewowi acc0edb
Mutex and moduleName
ewowi 75f6ea3
Small changes
ewowi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Drivers | ||
|
|
||
| ## Parallel LED Driver | ||
|
|
||
| ### Parlio (ESP32-P4) | ||
|
|
||
| ### Parallel LED Driver Technical Implementation | ||
|
|
||
| For end-user documentation, see [Parallel LED Driver for ESP32-P4](#parallel-led-driver-for-esp32-p4). | ||
|
|
||
| **Architecture Overview:** | ||
|
|
||
| The driver implements variable LEDs-per-pin support without intermediate buffers by padding during the transpose operation. Located in `src/MoonLight/Nodes/Drivers/parlio.cpp` with header `parlio.h`, called from `D_ParallelLEDDriver.h`. | ||
|
|
||
| **Key Functions:** | ||
|
|
||
| 1. **`show_parlio()`** (parlio.cpp:409-414): Entry point receiving compact `channelsD` buffer and `leds_per_output[]` array. Computes two global state variables: | ||
| - `max_leds_per_output`: Maximum across all pins | ||
| - `first_index_per_output[16]`: Cumulative offsets for random access into compact buffer | ||
|
|
||
| 2. **`create_transposed_led_output_optimized()`** (parlio.cpp:297): Main processing loop iterating `0..max_leds_per_output`. Applies color remapping (`offsetR/G/B/W`) and brightness LUTs before calling transpose. | ||
|
|
||
| 3. **`transpose_32_slices()`** (parlio.cpp:181-183): **Core padding mechanism** using single conditional: | ||
|
|
||
| ```cpp | ||
| const uint8_t data_byte = pixel_in_pin < pixels_per_pin[pin] | ||
| ? brightness_cache[input_buffer[component_idx]] // Actual LED | ||
| : 0; // Padding (black) | ||
| ``` | ||
|
|
||
| When pixel_in_pin exceeds a pin's actual LED count, outputs zero, creating black padding pixels. | ||
|
|
||
| Data Flow: Input buffer remains compact (Σ(leds_per_pin[i]) × channels) → show_parlio() builds indexing structures → create_transposed_led_output_optimized() iterates to max → transpose_32_slices() conditionally reads/pads → DMA buffer written with uniform alignment → PARLIO hardware transmits. | ||
|
|
||
| Performance: Zero memory overhead for padding, O(1) offset lookup via first_index_per_output[], minimal branching in hot path. Chunking logic (parlio.cpp:480-505) handles large LED counts exceeding DMA limits. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broken internal link fragment.
The anchor
#parallel-led-driver-for-esp32-p4doesn't exist in this document. Based on the docs/moonlight/drivers.md content, the correct link would be to that file's#parallel-led-driversection, or remove the link if it's meant to be internal.Proposed fix
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
9-9: Link fragments should be valid
(MD051, link-fragments)
🤖 Prompt for AI Agents