-
Notifications
You must be signed in to change notification settings - Fork 2
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
add a current_standby()
method when the pin implements StatefulOututPin
#26
Conversation
thanks a lot for your PR! please leave out the what is the reason for having as a general suggestion:
|
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.
see previous comment
I've updated the commits to reflect on the changes to This is more about consistency, the |
sorry for not having replied yet. i'm still contemplating whether it actually makes sense to have these methods (both what was the reason why you contributed this method? do you have a use-case which is being simplified by having this method? |
I used it as the owner of the current state when printing it back to the user. Alternatively as you say, if you are storing the current state somewhere else which you are using to control the Driver then I could just print that to the user instead and expect the Driver to always match it. In fact, I now use the second method and no longer need this pull request. Perhaps you could also remove the |
i certainly want to have it consistent, i'm just unsure which option is better. but i guess it's not a big deal to have this method to make it easier for consumers. i just realised an inconsistency: when i create the |
@ripytide: it'd be great to get your feedback on my previous comment! |
I didn't mean to add the version commit to this PR I was using my GitHub fork as a cargo git dependency while debugging some embedded_hal version issues. As for your previous comment, I think it's more flexible for the library consumers to keep the internal state, including for standby, since even if they don't use it it doesn't hurt to have the functionality available. I would also agree that |
great! then i'd propose to do the following in three separate PRs:
feel free to contribute any of the other two PRs besides this one! otherwise i'll try to get around to them at some point (though i'm a bit busy right now with other things, might take a week or so) do you know the answer to this one?
|
I'll have a go at the pr's tomorrow.
|
current_standby()
method when the pin implements StatefulOututPin
, and fix clippy+testscurrent_standby()
method when the pin implements StatefulOututPin
@rursprung This PR and #35 should now be ready for review. |
in general, this looks good to me. as agreed, we'll first get #37 in and then merge this. when you rebase this (and adapt it to propagate the error) please also squash the commits |
@rursprung I've rebased and squashed this PR now that #37 is merged so this should be ready for review |
thanks @ripytide! |
Let me know if there is a better name than
current_standby