Skip to content

Commit b1db675

Browse files
committed
More parlio tweaks
1 parent 2fc6420 commit b1db675

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

docs/moonbase/inputoutput.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,15 @@ For each board the following presets are defined:
6969

7070
### MyHome-Control ESP32-P4 shield
7171

72-
* Choose the esp32-p4-nano board in the [MoonLight Installer](../../gettingstarted/installer/)
73-
* On new boards, the WiFi coprocessor needs to be updated first to a recent version, currently v2.0.17, see the link in the [MoonLight Installer](../../gettingstarted/installer/)
74-
* After install, select the **MHC P4 Nano Shield** board preset to have the pins assigned correctly.
75-
* Assuming 100W LED power; change if needed.
76-
* Jumper1: off (default): 16 LED pins. On: 8 LED pins, 4 RS-485 pins and 4 exposed pins (set also the switches on the board).
77-
* Add the Parallel LED Driver, see [Drivers](../../moonlight/drivers/). It uses @troyhacks his parallel IO driver to drive all LED pins configured for the shield.
78-
7972
![ESP32-P4 shield](https://shop.myhome-control.de/thumbnail/87/41/c2/1762031307/WLED_ESP32_P4_Shield_02_1920x1326.jpg?ts=1762031315){: style="width:320px"}
8073

81-
[ESP32-P4 shield](https://shop.myhome-control.de/en/ABC-WLED-ESP32-P4-shield/HW10027)
74+
* See [ESP32-P4 shield](https://shop.myhome-control.de/en/ABC-WLED-ESP32-P4-shield/HW10027). Choose the esp32-p4-nano board in the [MoonLight Installer](../../gettingstarted/installer/)
75+
* On new ESP32-P4 Nano boards, the WiFi coprocessor needs to be updated first to a recent version, currently ESP-Hosted v2.0.17, see the link in the [MoonLight Installer](../../gettingstarted/installer/)
76+
* After install, select the **MHC P4 Nano Shield** board preset to have the pins assigned correctly.
77+
* Assuming 100W LED power; change if needed.
78+
* Jumper1: off (default): 16 LED pins. On: 8 LED pins, 4 RS-485 pins and 4 exposed pins (set also the switches on the board).
79+
* Add the Parallel LED Driver, see [Drivers](../../moonlight/drivers/). It uses [@troyhacks](https://github.com/troyhacks) his parallel IO driver to drive all LED pins configured for the shield.
80+
8281

8382
### SE16 v1
8483

docs/moonlight/drivers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Want to add a Driver to MoonLight, see [develop](../../develop/overview/). See a
4646

4747
### Light Preset
4848

49-
* **Max Power**: 🆕 moved to [IO Module](../../moonbase/inputoutput/) board presets.
49+
* **Max Power**: 🆕 moved to [IO Module](../../moonbase/inputoutput) board presets.
5050

5151
* **Light preset**: Defines the channels per light and color order
5252

@@ -82,7 +82,7 @@ Receives Art-Net data from the network.
8282
!!! tip "Other setup"
8383
* Add a Layout driver to specifify the fixture you are displaying on, e.g. Single Line for Tubes or Panel for Matrices
8484
* Add the Parallel LED Driver to enable connected LEDs
85-
* Go to the [IO Module](../../moonbase/inputoutput/) to define a board preset.
85+
* Go to the [IO Module](../../moonbase/inputoutput) to define a board preset.
8686

8787
!!! tip "Running effects and Art-Net In"
8888
Effects can run at the same time, disable or delete them if you only want to run Art-Net In.

src/MoonLight/Nodes/Drivers/D_ParallelLEDDriver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ParallelLEDDriver : public DriverNode {
4545
#endif
4646
}
4747

48-
uint8_t pins[MAX_PINS];
48+
uint8_t pins[MAX_PINS] = {};
4949

5050
void loop() override {
5151
#if HP_ALL_DRIVERS

src/MoonLight/Nodes/Drivers/parlio.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ void create_transposed_led_output_optimized(const uint8_t* input_buffer, uint16_
201201
for (uint32_t pixel_in_pin = 0; pixel_in_pin < pixels_per_pin; ++pixel_in_pin) {
202202
for (uint32_t component_in_pixel = 0; component_in_pixel < COMPONENTS_PER_PIXEL; ++component_in_pixel) {
203203
const uint32_t input_component = component_map[component_in_pixel];
204+
//component_in_pixel is always RGB(W) - looping over the input array
205+
//input_component is offsetR,G,B e.g. GRB -> 102, so this loop starts with 1 / green, so green is first processed, then red, then blue
204206

205207
uint32_t transposed_slices[32];
206208

@@ -420,15 +422,15 @@ uint8_t IRAM_ATTR __attribute__((hot)) show_parlio(uint8_t* parallelPins, uint32
420422
chunk_ptrs[3] = chunk_ptrs[2] + chunk_stride_bytes;
421423

422424
unsigned long before = micros();
423-
ESP_ERROR_CHECK(parlio_tx_unit_wait_all_done(parlio_tx_unit, -1));
425+
ESP_ERROR_CHECK(parlio_tx_unit_wait_all_done(parlio_tx_unit, portMAX_DELAY));
424426
unsigned long after = micros();
425427

426428
#ifdef WLEDMM_REMAP_AT_OUTPUT
427429
parallel_buffer_remapped = (parallel_buffer_remapped == parallel_buffer_remapped1) ? parallel_buffer_remapped2 : parallel_buffer_remapped1;
428430
#endif
429431
parallel_buffer_repacked = (parallel_buffer_repacked == parallel_buffer_repacked1) ? parallel_buffer_repacked2 : parallel_buffer_repacked1;
430432

431-
// if (after - before < 50) delayMicroseconds(20);
433+
if (after - before < 50) delayMicroseconds(20);
432434

433435
// portENTER_CRITICAL(&parlio_spinlock);
434436
for (int i = 0; i < num_chunks && i < 4; ++i) {

0 commit comments

Comments
 (0)