Implement TemperatureThresholdWait trait#17
Merged
RobertZ2011 merged 1 commit intoOpenDevicePartnership:mainfrom May 19, 2025
Merged
Implement TemperatureThresholdWait trait#17RobertZ2011 merged 1 commit intoOpenDevicePartnership:mainfrom
RobertZ2011 merged 1 commit intoOpenDevicePartnership:mainfrom
Conversation
Contributor
Author
|
@kjasani111 Welcome your input as well. |
felipebalbi
requested changes
May 8, 2025
504aa45 to
5e48a12
Compare
felipebalbi
requested changes
May 8, 2025
5e48a12 to
d4ffbaa
Compare
felipebalbi
reviewed
May 8, 2025
d4ffbaa to
80cbe60
Compare
felipebalbi
reviewed
May 9, 2025
80cbe60 to
4da3b5c
Compare
felipebalbi
approved these changes
May 16, 2025
RobertZ2011
approved these changes
May 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the
embedded-sensorsTemperatureThresholdWaittrait.Unfortunately requires breaking existing interface, even when
embedded-sensors-hal-asyncfeature is not enabled. The alternative is to duplicate a lot of code and have a feature gate for the version that has the genericALERT: embedded_hal_async::digital::Wait, but that does not seem worth it.The other alternative which I'm open to is making
wait_for_temperature_thresholdrequire an ALERT pin as an argument, thus the Tmp108 struct wouldn't need a generic field for it. I was unsure about this, as having to pass a pin instantiation around until it gets to the call site might not be very ergonomic. Curious if others feel this is the better route though.Driver might also benefit from additional typestate so polarity and thermostat mode don't need to be checked at runtime, which I'm open to implementing as well.
Resolves #15