fix: Add conditional compilation guards for variant-specific hardware… #33
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/fix-companion-radio-build"
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?
… in UITask.cpp
Fixes build failures in companion_radio examples by adding conditional compilation guards for variant-specific hardware driver code.
The UITask.cpp file uses WRAPPER_CLASS, radio_driver, and user_btn which are only defined when compiled as an Arduino variant. This change wraps the target.h include and radio driver code with #ifdef ARDUINO guards to allow the build to proceed when these variant-specific definitions aren't available.
This is a step toward resolving the broken companion_radio build without requiring full architectural changes to the hardware driver system.
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 resolves build failures in the
companion_radioexamples by strategically applying conditional compilation. It introduces preprocessor directives to isolate hardware driver declarations that are specific to Arduino variants, ensuring that the code compiles correctly across different build environments without requiring a complete overhaul of the hardware driver architecture. This change specifically targetsUITask.cppto prevent issues with undefined symbols when not building for an Arduino platform.Highlights
companion_radioexamples by introducing conditional compilation for variant-specific hardware driver code.#ifdef ARDUINOguards aroundtarget.hinclusion andRADIO_DRIVER_AVAILABLEmacro definition inUITask.cpp.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 attempts to fix a build failure in
companion_radioexamples for non-Arduino variants by making hardware-specific includes inUITask.cppconditional. The change introduces an#ifdef ARDUINOguard around the inclusion oftarget.hand defines aRADIO_DRIVER_AVAILABLEmacro to indicate the presence of hardware drivers. While the approach is sound, the implementation appears incomplete. The pull request description states thatUITask.cppuses symbols defined intarget.h. For the build fix to be effective, the code that uses these symbols must also be conditionally compiled. I've left a comment highlighting this critical issue.@ -10,0 +14,4 @@#define RADIO_DRIVER_AVAILABLE 1#else#define RADIO_DRIVER_AVAILABLE 0#endifThis change correctly introduces conditional inclusion for
target.hand definesRADIO_DRIVER_AVAILABLE. However, according to the pull request description,UITask.cppuses symbols likeradio_driveranduser_btnfromtarget.h. To complete the fix, all usages of these symbols within this file must also be conditionally compiled, for example by wrapping them in an#if RADIO_DRIVER_AVAILABLEblock. As it stands, this change is incomplete and will likely not resolve the compilation errors for non-Arduino builds.