Skip to content

Handle cases of state interfaces with different data types #1783

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link
Member

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

LGTM, should we also add a test for that?

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

I was thinking to approach this in another way. I think we should have per default conversion between double and other types (if possible). This will help us with the reusability of HW interface and controllers. We had similar issues in CAN implementation and solved it with memcpy — there we have uint32_t variables for “transport storage”. I know this is not beautiful, but it is extremely useful. We should give a warning once per interface that we are handing the type using double but it is a compatible type and then just do it. Otherwise, I am afraid that we will end up in the endless if - else if loops and having many issues with the controllers — HW incompatibilities, even though they could work with the proposed type support.

What I want to say, we should add this casting to the handles and not in the controllers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants