Skip to content

Remove V1 usermod#4828

Open
netmindz wants to merge 2 commits into
mainfrom
remove-v1-usermod
Open

Remove V1 usermod#4828
netmindz wants to merge 2 commits into
mainfrom
remove-v1-usermod

Conversation

@netmindz

@netmindz netmindz commented Aug 9, 2025

Copy link
Copy Markdown
Member

Remove legacy usermod

Summary by CodeRabbit

  • Refactor

    • Streamlined usermod integration to rely on the central usermod manager for lifecycle events, removing legacy callback paths.
  • Chores

    • Removed unused usermod template code and related documentation.

Review Change Stack

@netmindz netmindz added this to the 0.16.0 candidate milestone Aug 9, 2025
@coderabbitai

coderabbitai Bot commented Aug 9, 2025

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 94d0487e-c5cb-47df-8975-e234f99badb1

📥 Commits

Reviewing files that changed from the base of the PR and between 0a21869 and 1795797.

📒 Files selected for processing (2)
  • wled00/fcn_declare.h
  • wled00/wled.cpp
💤 Files with no reviewable changes (2)
  • wled00/fcn_declare.h
  • wled00/wled.cpp

Walkthrough

This change removes the legacy usermod callback functions (userSetup(), userConnected(), userLoop()) from the codebase. Their declarations are deleted from the header, their empty implementation file is removed, and all direct invocations are replaced with calls to the UsermodManager equivalents in the main application logic.

Changes

Usermod removal and rewiring

Layer / File(s) Summary
Remove legacy declarations
wled00/fcn_declare.h
Removed declarations of userSetup(), userConnected(), and userLoop().
Wiring: replace direct user calls with UsermodManager
wled00/wled.cpp
Replaced direct calls to userLoop(), userSetup(), and userConnected() with UsermodManager::loop(), UsermodManager::setup(), and UsermodManager::connected().
Deleted legacy stub
wled00/usermod.cpp
Removed the empty usermod implementation file that contained the legacy callback stubs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Suggested labels: usermod

Suggested reviewers:

  • willmmiles
  • softhack007
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing the V1 usermod legacy system (function declarations, the usermod.cpp template file, and direct function calls). It is concise and specific.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@willmmiles

Copy link
Copy Markdown
Member

There are several v1 usermods still in the tree -- they should get ported to v2 before we merge this. As it turns out, the v1 usermod binding is actually fully compatible with the "usermods as libraries" approach, though you can only enable one (it'll throw a linker error otherwise).

@netmindz

Copy link
Copy Markdown
Member Author

How does that work then? Does the compiler just treat the CPP fille as if it's a duplicate header definition as the function is empty and magically switch to the version in the other directory if on the include path?

@willmmiles

Copy link
Copy Markdown
Member

Well blow me sideways - I wrote it months ago, but I never merged that patch! It was in my TTGO-T-Display usermod branch, PR #4600. I'd flagged it as draft as I didn't have the hardware to test it. (I have something "close enough" on my test block now; works fine, I should dust it off and submit.)

But yes - that's pretty much how it works, through the power of weak symbols. The definitions in wled00/usermod.cpp can be flagged to be linked in only if no other source file defines them.

Sorry for the confusion.

@netmindz netmindz self-assigned this Oct 5, 2025
@netmindz netmindz modified the milestones: 16.0.0 beta, 16.1 Mar 28, 2026
@softhack007 softhack007 added the keep This issue will never become stale/closed automatically label May 29, 2026
@coderabbitai coderabbitai Bot added the usermod usermod related label May 29, 2026
@softhack007 softhack007 modified the milestones: 16.1, 17.0 Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

keep This issue will never become stale/closed automatically usermod usermod related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants