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

Generate min/max consts for signals #38

Merged
merged 4 commits into from
Apr 12, 2021

Conversation

andresv
Copy link
Contributor

@andresv andresv commented Apr 12, 2021

This PR adds consts for signal min/max values.

impl Amet {
    pub const MESSAGE_ID: u32 = 1024;

    pub const ONE_MIN: u8 = 0_u8;
    pub const ONE_MAX: u8 = 3_u8;
    pub const TWO_MIN: f32 = 0_f32;
    pub const TWO_MAX: f32 = 100_f32;
    pub const THREE_MIN: u8 = 0_u8;
    pub const THREE_MAX: u8 = 7_u8;
    pub const FOUR_MIN: u8 = 0_u8;
    pub const FOUR_MAX: u8 = 3_u8;
...
}

Copy link
Member

@killercup killercup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Can you maybe add a small test that just prints a min/max pair?

src/lib.rs Outdated Show resolved Hide resolved
testing/can-messages/src/messages.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@andresv
Copy link
Contributor Author

andresv commented Apr 12, 2021

Added test for min/max.

Copy link
Member

@killercup killercup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick updates! LGTM

@killercup killercup merged commit be270c9 into technocreatives:main Apr 12, 2021
@andresv andresv deleted the min-max-consts branch April 12, 2021 09:40
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.

None yet

2 participants