Skip to content

Add sanity checks for ethernet config table and WLED_ETH_DEFAULT#5608

Merged
softhack007 merged 1 commit into
mainfrom
softhack007-patch-1
May 12, 2026
Merged

Add sanity checks for ethernet config table and WLED_ETH_DEFAULT#5608
softhack007 merged 1 commit into
mainfrom
softhack007-patch-1

Conversation

@softhack007
Copy link
Copy Markdown
Member

@softhack007 softhack007 commented May 12, 2026

Small helper for integrators by compile-time sanity checks:

  • WLED_NUM_ETH_TYPES is aligned with the boards table
  • WLED_ETH_DEFAULT is aligned with the boards table

Can be merged into 17.0.0, 16.0.0, and 0.15.x branch

Summary by CodeRabbit

  • Chores
    • Added compile-time validation for Ethernet configuration settings to ensure configuration consistency.

Review Change Stack

Small helper for integrators by compile-time sanity checks:
* WLED_NUM_ETH_TYPES is aligned with the boards table
* WLED_ETH_DEFAULT is aligned with the boards table

-> can be merged into 17.0.0, 16.0.0, and 0.15.x branch
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

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: 65e84d03-2540-49aa-be5a-e7520db9b1bb

📥 Commits

Reviewing files that changed from the base of the PR and between 4ba60a6 and e645892.

📒 Files selected for processing (1)
  • wled00/network.cpp

Walkthrough

This PR adds compile-time sanity checks to the Ethernet configuration in wled00/network.cpp. Two static_assert statements verify that the ethernetBoards[] array length matches the WLED_NUM_ETH_TYPES count and that WLED_ETH_DEFAULT, if defined, falls within the valid enum range.

Changes

Ethernet Configuration Validation

Layer / File(s) Summary
Static assertion checks for Ethernet configuration
wled00/network.cpp
Two static_assert statements verify that ethernetBoards[] size matches WLED_NUM_ETH_TYPES and that WLED_ETH_DEFAULT is within the valid enum range [WLED_ETH_NONE, WLED_NUM_ETH_TYPES).

Possibly related PRs

  • wled/WLED#5156: Expands WLED_NUM_ETH_TYPES and adds a new entry to ethernetBoards[], directly affected by the new compile-time checks.
  • wled/WLED#5553: Adds two new Ethernet entries and increases WLED_NUM_ETH_TYPES, values that these new validation checks enforce.

Suggested labels

enhancement

Suggested reviewers

  • DedeHai

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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: adding compile-time sanity checks for the Ethernet configuration table and WLED_ETH_DEFAULT constant, which matches the file modifications described.
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.

@softhack007
Copy link
Copy Markdown
Member Author

tested locally, does what it should 👍

@softhack007 softhack007 merged commit 8e94cf5 into main May 12, 2026
53 of 54 checks passed
@softhack007 softhack007 deleted the softhack007-patch-1 branch May 12, 2026 11:56
softhack007 added a commit that referenced this pull request May 12, 2026
Add sanity checks for ethernet config table and WLED_ETH_DEFAULT
softhack007 added a commit that referenced this pull request May 12, 2026
Add sanity checks for ethernet config table and WLED_ETH_DEFAULT
softhack007 added a commit to MoonModules/WLED-MM that referenced this pull request May 12, 2026
Add sanity checks for ethernet config table and WLED_ETH_DEFAULT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant