fix(d1l): workaround RadioLib IRQ pin bug and apply Gemini cleanup #49
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/d1l-radio-and-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This commit addresses two issues discovered during D1L INT pin optimization:
CRITICAL FIX: RadioLib Module IRQ pin reset bug
Gemini Code Review Cleanup:
Changes:
Testing:
🤖 Generated with Claude Code
Description
Type of Change
Related Issues
Testing Performed
Hardware Tested
Code Quality Checklist
Breaking Changes
Screenshots/Logs
Additional Notes
Summary of Changes
Hello @okapteinis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request enhances the stability and efficiency of the D1L device's radio communication and interrupt handling. It resolves a critical bug affecting the RadioLib module's interrupt pin initialization and streamlines I2C operations for GPIO expander reads, leading to more reliable and performant system behavior.
Highlights
target.cppto address a RadioLib bug whereradio.begin()incorrectly resets the Module IRQ pin. The fix verifies and restores the correct pin (103) to prevent "attachInterrupt real pin -1" errors and ensure proper radio transmission.pollVirtualInterruptsInternal()inCustomRadioLibHal.cppto leveragereadAllInputs(), eliminating code duplication and significantly reducing I2C transactions (from 16 to 2) for reading all 16 TCA9535 inputs. The interrupt handler documentation and implementation were updated to use ado/whileloop for robust level-triggered interrupt handling, preventing missed events.Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either
/gemini <command>or@gemini-code-assist <command>. Below is a summary of the supported commands on the current page./gemini review/gemini summary/gemini helpCustomization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a
.gemini/folder in the base of the repository. Detailed instructions can be found here.Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩︎
Code Review
This pull request introduces a critical workaround for a RadioLib bug that resets the IRQ pin, and also includes a significant performance improvement by refactoring the virtual interrupt polling logic. The changes are well-documented and the refactoring correctly reduces I2C bus traffic. My feedback focuses on improving logging consistency in one of the changed files to align with the project's existing practices.
@ -445,0 +456,4 @@Serial.printf("DEBUG: Module IRQ pin corrected to %d\n", radio->mod->irqPin);} else {Serial.println("DEBUG: Module IRQ pin is correct");}The use of
Serial.printfandSerial.printlnfor debugging and warnings is inconsistent with the existing use of the ESP-IDF logging framework (log_w,log_e, etc.) in this file. Using the logging framework provides benefits like log levels, filtering, and performance.I suggest replacing the
Serialcalls with the appropriatelog_*macros. This will make the logging consistent and controllable viaCORE_DEBUG_LEVEL.