Skip to content
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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Spamandritz
Copy link

No description provided.

/* Formula Slug - Sam Ritzo */

#pragma once

Copy link
Member

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)

// Start GPIOs ADC Conversion and Poll Status
class ADAX : public LTC68xxCommandCode {
public:
ADAX(MD md, CHG chg) {}
Copy link
Member

@calcmogul calcmogul May 14, 2020

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).

Copy link
Collaborator

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...

Copy link
Collaborator

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

Copy link
Author

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 {
Copy link
Collaborator

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.

Copy link
Author

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

Copy link
Member

@calcmogul calcmogul May 22, 2020

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.

@Spamandritz Spamandritz force-pushed the feature/bms-command-refactor branch from b7fd9b3 to 231d0dd Compare May 18, 2020 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants