[RF] Fix CC1101 not initializing on boot when config exists#2268
[RF] Fix CC1101 not initializing on boot when config exists#22681technophile wants to merge 1 commit intodevelopmentfrom
Conversation
Fixes #2264 When RF configuration was saved to NVS, the CC1101 module would not initialize properly on boot, requiring a manual toggle between RTL_433 and RF modes in the WebUI to activate it. Root cause: The loadFromStorage() method in RFConfiguration.cpp loaded the saved configuration but failed to call iRFReceiver.enable() when config existed. This only affected users with saved configurations. The "no config found" path correctly called enable(), and the loadFromMessage() method (used by WebUI) also called disable()/enable(), explaining why the WebUI workaround worked. Solution: Add iRFReceiver.enable() after loading configuration in loadFromStorage() to match the behavior of both the "no config" branch and the loadFromMessage() method. This ensures both code paths (config exists vs. doesn't exist) behave identically: load config, then enable receiver. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Code Review: PR #2268 - Fix CC1101 not initializing on boot when config existsSummaryThis PR addresses a critical bug where the CC1101 RF module fails to initialize properly on boot when a saved configuration exists in NVS. The fix is a simple one-line addition that ensures Code Quality: ✅ EXCELLENTStrengths:
Analysis:Looking at Before the fix:
After the fix:
Comparison with iRFReceiver.disable();
iRFReceiver.enable();This method always reinitializes the receiver, explaining why the WebUI workaround worked. Potential Issues:
|
Fixes #2264
When RF configuration was saved to NVS, the CC1101 module would not initialize properly on boot, requiring a manual toggle between RTL_433 and RF modes in the WebUI to activate it.
Root cause: The loadFromStorage() method in RFConfiguration.cpp loaded the saved configuration but failed to call iRFReceiver.enable() when config existed. This only affected users with saved configurations.
The "no config found" path correctly called enable(), and the loadFromMessage() method (used by WebUI) also called disable()/enable(), explaining why the WebUI workaround worked.
Solution: Add iRFReceiver.enable() after loading configuration in loadFromStorage() to match the behavior of both the "no config" branch and the loadFromMessage() method.
This ensures both code paths (config exists vs. doesn't exist) behave identically: load config, then enable receiver.
🤖 Generated with Claude Code
Description:
Checklist: