-
Notifications
You must be signed in to change notification settings - Fork 9
Humidity API #30
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
Humidity API #30
Conversation
apis/humidity/src/lib.rs
Outdated
|
|
||
| /// Initiate a synchronous humidity measurement. | ||
| /// Returns Ok(humidity_value) if the operation was successful | ||
| /// humidity_value is returned in hundreds of centigrades |
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.
What is the measurement unit returned?
apis/humidity/src/lib.rs
Outdated
| pub fn read_sync() -> Result<u32, ErrorCode> { | ||
| let listener: Cell<Option<(u32,)>> = Cell::new(None); | ||
| share::scope(|subscribe| { | ||
| if let Ok(()) = Self::register_listener(&listener, subscribe) { |
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.
This is incorrect. This function should return the error that either subscribe or read return.
src/lib.rs
Outdated
| Error, GpioInterruptListener, GpioState, InputPin, OutputPin, PinInterruptEdge, Pull, | ||
| PullDown, PullNone, PullUp, | ||
| }; | ||
| pub use gpio::{Error, GpioInterruptListener, GpioState, InputPin, OutputPin, PinInterruptEdge, Pull, PullDown, PullNone, PullUp}; |
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.
| pub use gpio::{Error, GpioInterruptListener, GpioState, InputPin, OutputPin, PinInterruptEdge, Pull, PullDown, PullNone, PullUp}; | |
| pub use gpio::{ | |
| Error, GpioInterruptListener, GpioState, InputPin, OutputPin, PinInterruptEdge, Pull, | |
| PullDown, PullNone, PullUp, | |
| }; |
I ran cargo fmt and this is the formatted source.
Fixes #12
Based on alex's previous work from here
Heavily inspired from the work done #5
This PR would ad the api, an exemple, fake driver and tests.