-
Notifications
You must be signed in to change notification settings - Fork 109
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
Ambient Light API #465
Ambient Light API #465
Conversation
I tested this on Imix (using #466) and it appears to work correctly! |
Using |
apis/ambient_light/src/lib.rs
Outdated
|
||
/// Register an events listener | ||
pub fn register_listener<'share>( | ||
listener: &'share Cell<Option<(u32,)>>, |
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.
I think we did this wrong here. We need to be able to register a listener that the user can actually use outside this crate, meaning that the listener needs to have a function that is called when the upcall is fired.
Something similar to the ButtonListener
should work.
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.
bors r+
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Pull Request Overview
This PR adds an Ambient Light API, which includes:
Alongside the API, this PR adds a fake driver (and unit tests for it) for testing the API.
Testing Strategy
This pull request was tested using unit tests made specifically for this API and fake driver.
TODO or Help Wanted
This pull request still needs feedback / code review.
Help is needed to test this on a board, as I do not have access to one which has a light sensor module
@hudson-ayers could you, please, test it on a imix