Skip to content

Commit 6b17669

Browse files
committed
Bugfix channelsE assignment + monitor using channelsD
1 parent 601fb8a commit 6b17669

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

docs/develop/architecture.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ MoonLight uses a multi-core, multi-task architecture on ESP32 to achieve smooth
1010
|------|------|----------|------------|-----------|---------|
1111
| **WiFi/BT** | 0 (PRO_CPU) | 23 | System | Event-driven | System networking stack |
1212
| **lwIP TCP/IP** | 0 (PRO_CPU) | 18 | System | Event-driven | TCP/IP protocol processing |
13-
| **Effect Task** | 0 (PRO_CPU) | 3 | 3-4KB | ~60 fps | Calculate LED colors and effects |
13+
| **Effect Task** | 0 (PRO_CPU) | 10 | 3-4KB | ~60 fps | Calculate LED colors and effects |
1414
| **ESP32SvelteKit** | 1 (APP_CPU) | 2 | System | 10ms | HTTP/WebSocket UI framework |
1515
| **Driver Task** | 1 (APP_CPU) | 3 | 3-4KB | ~60 fps | Output data to LEDs via DMA/I2S/LCD/PARLIO |
1616

17-
Effect Task (Core 0, Priority 3)
17+
Effect Task (Core 0, Priority 10)
1818

1919
- **Function**: Pure computation - calculates pixel colors based on effect algorithms
2020
- **Operations**: Reads/writes to `channels` array, performs mathematical calculations
@@ -162,7 +162,6 @@ Synchronization Flow
162162
void effectTask(void* param) {
163163
while (true) {
164164
if (layerP.lights.useDoubleBuffer) {
165-
layerP.lights.channelsE = layerP.lights.channelsD;
166165

167166
layerP.loop(); // getRGB and setRGB both use channelsBack
168167

@@ -177,7 +176,6 @@ void effectTask(void* param) {
177176
} else {
178177
xSemaphoreTake(swapMutex, portMAX_DELAY);
179178
layerP.loop();
180-
181179
xSemaphoreGive(swapMutex);
182180
}
183181
vTaskDelay(1);

src/MoonLight/Modules/ModuleLightsControl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ class ModuleLightsControl : public Module {
372372
extern SemaphoreHandle_t swapMutex;
373373

374374
xSemaphoreTake(swapMutex, portMAX_DELAY);
375-
_socket->emitEvent("monitor", (char*)layerP.lights.channelsE, MIN(layerP.lights.header.nrOfChannels, layerP.lights.maxChannels));
375+
_socket->emitEvent("monitor", (char*)layerP.lights.channelsD, MIN(layerP.lights.header.nrOfChannels, layerP.lights.maxChannels));
376376
xSemaphoreGive(swapMutex);
377377
}
378378
});

src/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ void effectTask(void* pvParameters) {
129129
while (true) {
130130
if (layerP.lights.useDoubleBuffer) {
131131
// effectTask always writes to channelsBack, reads previous channelsBack
132-
layerP.lights.channelsE = layerP.lights.channelsD;
133132
layerP.loop(); // getRGB and setRGB both use channelsBack
134133

135134
if (millis() - last20ms >= 20) {

0 commit comments

Comments
 (0)