fix(d1l): expose radio globals and guard initialization for companion… #40
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/d1l-comprehensive-fixes"
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?
… builds
This fix implements "Option 1" to resolve build failures for the SenseCapIndicator-D1L_companion environment while maintaining repeater functionality.
Changes:
This ensures:
✓ Global radio variables are always visible to satisfy linker ✓ Radio hardware is only initialized when WRAPPER_CLASS is defined ✓ Repeater build succeeds with full radio functionality ✓ Companion target.cpp compiles successfully without radio hardware
Resolves GitHub Actions build failure in companion environment.
🤖 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 addresses and resolves build failures in the
SenseCapIndicator-D1L_companionenvironment by strategically modifying radio-related declarations and conditionally compiling hardware initialization. The primary goal is to enable successful compilation for companion builds without impacting the full radio functionality required by repeater builds.Highlights
SenseCapIndicator-D1L_companionenvironment, ensuring successful compilation.target.cppis now guarded by#ifdef WRAPPER_CLASS, preventing initialization in companion builds where it's not needed.radio_driverdeclaration intarget.hwas updated to use the concrete typeCustomSX1262Wrapperinstead of a macro, ensuring global radio variables are always visible to the linker.LORA_TX_POWERof 20 is now provided intarget.cppif not already defined, improving compilation compatibility forCustomSX1262.h.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 correctly addresses a build failure for the
SenseCapIndicator-D1L_companionenvironment. The changes are well-targeted and effective. Guarding the radio initialization logic with#ifdef WRAPPER_CLASScorrectly prevents hardware-specific code from being compiled for the companion build. Changing theexterndeclaration forradio_driverintarget.hto use a concrete type is a clean solution to make the declaration valid across all build environments. The addition of a defaultLORA_TX_POWERalso resolves a compilation dependency. I have one suggestion to improve the maintainability of the configuration.@ -4,0 +5,4 @@// Provide default LORA_TX_POWER for companion builds#ifndef LORA_TX_POWER#define LORA_TX_POWER 20#endifWhile adding this default define here fixes the compilation issue, a cleaner approach for better maintainability is to manage this configuration within the build environment itself. This keeps all build-specific settings consolidated in one place.
Consider removing this block and instead adding the following to the
build_flagsfor theSenseCapIndicator-D1L_companionenvironment invariants/sensecap_indicator_d1l/platformio.ini:This would make the configuration more explicit and easier to manage alongside other environment-specific flags.