Skip to content

Add effect development guide - #7

Merged
aphelps-claude-bot merged 1 commit into
mainfrom
new-effect-guide
Apr 18, 2026
Merged

aphelps-claude-bot merged 1 commit into
mainfrom
new-effect-guide

Conversation

@aphelps-claude-bot

Copy link
Copy Markdown
Collaborator

Summary

  • Adds docs/effect-development-guide.md: a 12-section reference covering effect anatomy, the PROGMEM descriptor format, Segment API, timing, SEGENV state, scratch memory allocation, audio/touch reactivity, and pointers to further reading in the codebase
  • No firmware changes

Test plan

  • Read through guide and verify accuracy against current ampworks.cpp effects
  • Confirm all API references (blendPixelColor, allocateData, etc.) match signatures in FX.h

🤖 Generated with Claude Code

Comment thread docs/effect-development-guide.md Outdated
## 1. Overview

WLED effects are C++ functions called every frame (~16 ms) that write colors
to a segment of LEDs. Custom effects in this repo live in `ampworks.cpp` and

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guide should not be specific to my ampworks changes. Effects should either go into FX.cpp, or include the steps to create a new usermodule and add them with it.

@aphelps-claude-bot aphelps-claude-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewritten — the guide now opens with a path-chooser table (FX.cpp vs usermod), walks through both registration paths with code examples, and keeps the API reference sections generic. Removed ampworks-specific references; the cross-usermod data section now shows the general lookup pattern rather than MPR121 specifically. The 'Where to Look' table points to upstream WLED source files.

@aphelps aphelps left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge

docs/effect-development-guide.md covers both paths for adding a new
effect: directly in FX.cpp or via a custom usermod. Includes the
PROGMEM descriptor format, Segment API, frame timing, SEGENV state,
scratch memory, audio reactivity, cross-usermod data patterns, and
pointers to further reading in the codebase.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@aphelps-claude-bot
aphelps-claude-bot merged commit 088a994 into main Apr 18, 2026
@aphelps-claude-bot
aphelps-claude-bot deleted the new-effect-guide branch April 18, 2026 20:03
aphelps pushed a commit that referenced this pull request Aug 29, 2026
esp-now-router#7 merged after this branch was opened, which would have left the
pointer one commit stale the moment #42 landed — the exact recurring miss this
PR exists to fix, reproduced inside the fix for it.

847f30c registers test_espnow_start in the router's SUITES list. Verified from
the superproject: `make test-router` at this pointer now NAMES
test_espnow_start/test_espnow_start and passes it. At 04d0ad2 it did not run at
all, so the previous pointer would have carried #6's code without #6's test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F4oTr1YW3z7ozksMUT1z5j
aphelps-claude-bot added a commit that referenced this pull request Aug 29, 2026
* Bump esp-now-router 07c264f -> 04d0ad2 (three merges behind)

The superproject recorded 07c264f2, so `make test-router` and CI were exercising
sources from before #4. Three merges were missing:

  #4  the WLED coordinator (onboard/drive devices from firmware)
  #5  coordinator mode gate + blacklist a target that fails a hop
  #6  start ESP-NOW after the STA associates

#6 in particular is not optional for anyone building from this repo: without it
the router pins the boot ESP-NOW channel, the TX confirm callback stops
arriving, and 100% of adverts fail — so a WLED_dev pinned before it records a
backbone that cannot form.

Verified rather than assumed: `make test-router` at the new pointer runs and
passes the coordinator-era suites (test_coord_mode, test_coord_phase,
test_coord_boot, test_onboard_cfg, test_candidate, test_hmtl_to_wled), none of
which exist at 07c264f2. That is the evidence the newer sources are being built,
rather than a green tick from the old ones.

This is the fifth time work has landed where nothing pointed at it. The durable
fix — CI failing when a submodule's origin/main is ahead of the recorded pointer
— is still unbuilt and would have caught every instance.

Known follow-up: esp-now-router#7 registers test_espnow_start in that repo's
SUITES list; it is absent at this pointer, so `make test-router` will not run it
until #7 merges and the pointer moves again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F4oTr1YW3z7ozksMUT1z5j

* Re-point to 847f30c so the bump carries #7 as well

esp-now-router#7 merged after this branch was opened, which would have left the
pointer one commit stale the moment #42 landed — the exact recurring miss this
PR exists to fix, reproduced inside the fix for it.

847f30c registers test_espnow_start in the router's SUITES list. Verified from
the superproject: `make test-router` at this pointer now NAMES
test_espnow_start/test_espnow_start and passes it. At 04d0ad2 it did not run at
all, so the previous pointer would have carried #6's code without #6's test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F4oTr1YW3z7ozksMUT1z5j

---------

Co-authored-by: aphelps-claude-bot <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants