Add VREF wrapper to BSP#266
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the VS Code configuration for ARM-based Linux development, adds a function to retrieve the ADC reference voltage, and introduces a comprehensive CAN message header. Feedback identifies a bug in the adc_get_vref implementation where a channel macro is returned instead of a voltage value, unprofessional naming in the CAN header, incomplete test logic for ADC readings, and portability issues stemming from absolute paths in the workspace settings.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new adc_get_vref function to retrieve the ADC reference voltage, along with corresponding test cases in adc_test.c. The review feedback highlights several critical issues that need to be addressed: a stack buffer overflow in adc_get_vref caused by reading a 4-byte queue item into a 2-byte variable, a potential division-by-zero error, unsafe repeated initialization of a static queue, and logical issues in the test suite where success_handler() is called prematurely or omitted entirely. Additionally, it is recommended to make vref_readings static to prevent polluting the global namespace.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Just returns VREF for scaling adc readings.