Feature/fix radio driver guards #35
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/fix-radio-driver-guards"
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?
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 refines the conditional compilation logic for the radio driver, specifically by guarding the instantiation of the
MyMeshobject to ensure it's only built when the radio driver is available. It also includes minor formatting adjustments to preprocessor directives within the UI task file, enhancing code clarity and maintainability.Highlights
MyMeshobject instantiation inexamples/companion_radio/main.cppis now conditionally compiled using#if RADIO_DRIVER_AVAILABLE. This ensures that the mesh object is only created when a radio driver is present, preventing potential compilation issues or dead code when the driver is not available.#if RADIO_DRIVER_AVAILABLEand#endifdirectives inexamples/companion_radio/ui-new/UITask.cppfor improved code readability and consistency with surrounding code style.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 aims to add preprocessor guards for radio driver availability. The changes in
UITask.cppare minor stylistic improvements. However, the change inmain.cppis incomplete. It correctly guards the definition of thethe_meshobject, but it misses guarding its usages throughout the codebase, as well as other radio-dependent function calls. This will lead to build errors when the radio driver is not available. I've left a critical comment onmain.cppdetailing the issues and providing guidance on how to fully implement the required guards.@ -98,3 +99,4 @@, &ui_task#endif);#endifWhile this change correctly guards the definition of
the_mesh, it is incomplete and will lead to build errors whenRADIO_DRIVER_AVAILABLEis 0.Linker Error: The
externdeclaration forthe_meshinMyMesh.his unconditional, andthe_meshis used in several places in this file (setup()andloop()) and other files (UITask.cpp,MyMesh.cpp) without being guarded. This will cause a linker error asthe_meshwill be referenced but not defined.Compilation Errors: Other radio-specific functions are called without guards in
setup(). This will cause compilation errors.radio_init()on line 128radio_get_rng_seed()on line 130To fix this, you need to wrap all code that depends on the radio driver with
#if RADIO_DRIVER_AVAILABLE. For example:The
externdeclaration inMyMesh.hand all other usages ofthe_meshandradio_driveracross the project should also be guarded to ensure a successful build whenRADIO_DRIVER_AVAILABLEis 0.