Repository navigation
fix(macros): silence FASTLED_OVERCLOCK redef + A3/A4 #warning (#2728) - #2741
Conversation
Two macro-hygiene warnings fire on every FastLED CI workflow (50+ boards): 1. `FASTLED_OVERCLOCK redefined` — examples/Overclock/Overclock.ino defined the override AFTER `#include "FastLED.h"`, so led_timing.h's `#ifndef FASTLED_OVERCLOCK` guard saw it undefined and installed the default (1.0), then the .ino redefined it (1.1) — `-Wmacro-redefined`. Fix: move the override BEFORE the include with a comment documenting the requirement. 2. `#warning "A3 / A4 is not defined, using 3 / 4"` — author-emitted `#warning` pragmas in examples/LuminescentGrand/arduino/ui_state.cpp. The fallback itself is harmless — `A3`/`A4` are opaque pin numbers here, and many Arduino-core variants (ESP32, RP2040, nRF52, …) just don't expose those aliases. Replace `#warning` with a silent `#ifndef`+`#define` fallback. Net effect: hundreds of warnings per CI run removed. Closes #2728. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTwo compile-warning hygiene fixes across example sketches: A3/A4 pin fallbacks become silent numeric definitions instead of ChangesMacro Hygiene Cleanup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/Overclock/Overclock.ino`:
- Around line 15-20: The sketch defines FASTLED_OVERCLOCK before including
FastLED.h but doesn't set FASTLED_OVERCLOCK_SUPPRESS_WARNING, so led_timing.h
still emits a `#warning`; update the top of Overclock.ino to also define
FASTLED_OVERCLOCK_SUPPRESS_WARNING (in addition to FASTLED_OVERCLOCK) before the
`#include` "FastLED.h" so the compile-time warning is suppressed while keeping the
overclock value intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 175bafb7-1c00-4886-b008-6c12b4c86e51
📒 Files selected for processing (2)
examples/LuminescentGrand/arduino/ui_state.cppexamples/Overclock/Overclock.ino
- Add FASTLED_OVERCLOCK_SUPPRESS_WARNING to Overclock.ino to fully silence the led_timing.h #warning on CI builds Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Closes #2728.
Summary
Two macro-hygiene warning classes fire on every FastLED CI workflow (50+ boards). Pure noise that masks real signal.
#1.
FASTLED_OVERCLOCK redefinedRoot cause: the .ino has
#define FASTLED_OVERCLOCK 1.1AFTER#include \"FastLED.h\". By the time the .ino's#defineruns, led_timing.h has already seen the macro undefined and installed the default. The existing#ifndef FASTLED_OVERCLOCKguard in led_timing.h is correct — the .ino was wrong.Fix: move the .ino's
#define FASTLED_OVERCLOCK 1.1BEFORE the#include \"FastLED.h\". Add a comment documenting the requirement so the next person editing the example doesn't repeat the mistake.#2.
#warning A3 / A4 is not defined, using 3 / 4Author-emitted
#warningpragmas; fires on every ESP32/Teensy/RP/nRF/Due workflow.The fallback itself is harmless —
A3/A4are opaque pin numbers in this file, and many Arduino-core variants (ESP32, RP2040, nRF52, ...) just don't expose those aliases.Fix: drop the
#warninglines; keep the#ifndef+#definefallback silent.Test plan
bash lintclean🤖 Generated with Claude Code
Summary by CodeRabbit