-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/bms command refactor #14
base: main
Are you sure you want to change the base?
Conversation
/* Formula Slug - Sam Ritzo */ | ||
|
||
#pragma once | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need #include <stdint.h>
for uint8_t, uint16_t. (include-what-you-use)
bms/src/LTC68xxCommands.h
Outdated
// Start GPIOs ADC Conversion and Poll Status | ||
class ADAX : public LTC68xxCommandCode { | ||
public: | ||
ADAX(MD md, CHG chg) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to make member variables to store the ctor args in. This class probably doesn't even compile since none of the variables in toValue()
are in scope (unless the base class defines them, but exposing variables directly from base classes is poor practice).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm not sure how this successfully compiled...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... because it didn't get compiled. Not included anywhere. My bad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I'm dumb and removed them by mistake
public: | ||
virtual uint16_t toValue() const = 0; | ||
|
||
enum class MD : uint8_t { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% convinced on using the shortened names from the datasheet. It might be easier/cleaner to expand them.
Either way we should add some documentation here on what these keywords mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should end up being low-level commands only, I want it to reflect exactly what's going on in the datasheet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment should be added at the top of the file describing that design intent, so future maintainers don't mess that up during modifications. Design rationale is good to document somewhere in general.
b7fd9b3
to
231d0dd
Compare
No description provided.