fix(ci): restore D1L build + make logger portable #51
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/ci-d1l-followups"
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?
Fixes:
Gemini follow-ups from PR #50:
Make tools/d1l_logger.py portable:
Fix docs/hardware/D1L_GUIDE.md snippet mismatch:
Gemini follow-ups from PR #49:
Verified:
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 primarily focuses on improving the robustness and usability of the D1L build and its associated tooling. It addresses a critical CI build failure by correctly implementing a hardware abstraction layer function, enhances the D1L serial logger script for greater portability and ease of use across different operating systems, and refines the embedded device's logging mechanism for better consistency. Additionally, it updates relevant documentation to reflect these changes and prevent future discrepancies.
Highlights
pinToInterrupt()declaration inCustomRadioLibHal.hto correctly handle virtual pins, ensuring the D1L build succeeds.tools/d1l_logger.pyfor cross-platform compatibility by removing hardcoded paths/ports, introducingargparsefor flexible options, enabling auto-detection of serial ports on macOS/Linux, and utilizingpathlib.Pathfor robust path handling.CLAUDE.mdandD1L_GUIDE.mdwith the new logger usage examples and corrected aRecursiveSemaphoreLockGuardcode snippet inD1L_GUIDE.mdto include a 5-second timeout, potential deadlock messages, and an#ifdef ARDUINOguard.Serial.printfandSerial.printlncalls withlog_e,log_w, andlog_imacros intarget.cppfor improved logging consistency and severity-based output.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 delivers a good set of fixes and improvements. The logger script
tools/d1l_logger.pyis now much more portable and user-friendly thanks to the removal of hardcoded paths and the addition of command-line arguments. The accompanying documentation updates are clear and helpful. The fix for the missingpinToInterruptdeclaration and the standardization of logging macros intarget.cppimprove code quality and consistency. I've added a couple of suggestions for the logger script to further enhance its robustness and cross-platform compatibility.@ -15,2 +39,4 @@return Nonedef main():parser = argparse.ArgumentParser(The order of results from
glob.glob()is not guaranteed. If multiple serial devices match a pattern, the script might connect to a different one each time it's run, which can be confusing. Sorting the results provides deterministic behavior by always picking the first port alphabetically.@ -16,1 +41,4 @@def main():parser = argparse.ArgumentParser(description='D1L Serial Logger - Portable serial monitor with event logging',formatter_class=argparse.RawDescriptionHelpFormatter,While using
globworks for macOS and Linux, a more portable and robust solution would be to useserial.tools.list_ports.comports(). This function is part of thepyseriallibrary, works cross-platform (including Windows), and allows for more reliable detection based on USB Vendor ID (VID) and Product ID (PID). This would make the script truly portable.Here's a potential refactoring of
find_serial_port: