Conversation
…rote the read function and outlined precharge logic
Summary of ChangesHello @GavinW-UT, 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 establishes the initial firmware structure for an STM32G4xx microcontroller. It configures the system clock and essential peripherals such as ADCs, UART, and GPIOs. The changes lay the groundwork for critical functionalities, including the acquisition of motor and battery voltage data and the preliminary logic for a battery precharge sequence, which is vital for safe power-up in high-voltage systems. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
Customization 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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the initial firmware structure, including clock and ADC configuration, an ADC reading function, and precharge logic. The changes are a good start, but there are several critical issues that need to be addressed, including an incorrect file include, syntax errors, macros with trailing semicolons, and a potential division-by-zero error in the precharge logic. There is also a high-severity issue with an unhandled overvoltage condition. I've provided suggestions to fix these critical bugs and improve the code's robustness and safety. Additionally, there are some medium-severity suggestions for future performance improvements.
Rav4s
left a comment
There was a problem hiding this comment.
Good start, I left some comments. I think the main thing is to start compartmentalizing stuff into driver files (don't put all this in main) and write tests for each of those drivers. Also make sure to use the BSP ADC instead of the low-level HAL functions. and get all pins defined before continuing to hardcode stuff
…xed point instead of floating
Rav4s
left a comment
There was a problem hiding this comment.
Check the build output on github when you commit, the code doesn't compile for various reasons. You should be compiling and testing locally before pushing.
I don't see a test for precharge ADC reading, can you add a test that just samples the ADCs and prints the raw value + converted voltages?
Good work addressing the previous comments, I added some more :P
There was a problem hiding this comment.
you should get the contactor functions written as well, work with @CraigGleason7 on this, i think he has most of that stuff done already for BPS Leader
…t is prob some garbage, how makefile so i can build and fix errors
Rav4s
left a comment
There was a problem hiding this comment.
nice job, this is a huge improvement already! left a few more comments, let's start getting the test fleshed out so you can test on hardware soon
There was a problem hiding this comment.
you need to have a main for anything to execute in a test file. add your init functions for VCU to initialize clock, pins, adcs, leds, anything else you need. cubemx can generate most of these, just copy and paste what you need. also pls build this and test on LSOM once embedded-sharepoint adc is updated
No description provided.