-
-
Notifications
You must be signed in to change notification settings - Fork 771
Tock 2.0: update multi touch #2315
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
Tock 2.0: update multi touch #2315
Conversation
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 driver definitely needs its data parsing code cleaned up -- hard coded constants should be replaced by structures, etc.
@@ -147,12 +148,13 @@ impl<'a> i2c::I2CClient for Ft6x06<'a> { | |||
+ (buffer[touch_event * 8 + 5] as u16); | |||
let pressure = Some(buffer[touch_event * 8 + 6] as u16); |
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.
Ugh these embedded constants! I don't want to block a 2.0 update on fixing cruft like this, but fixing it seems pretty important from a maintenance perspective.
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 agree, but I'm not sure how to fix this. I can either:
- declare some consts instead of the hard coded numbers.
- have a struct instead of a buffer, but I'm not sure I can convert the struct to the array with some kind of
memcpy
that would be considered safe
Any suggestion is welcome.
bors r+ |
Build succeeded! And happy new year! 🎉 |
2315: Tock 2.0: update multi touch r=phil-levis a=alexandruradovici ### Pull Request Overview This pull request fixes: - a multi touch report bug for the touch driver by adding the ack command and updating the touch callbacks - the ft6x06 driver to report the touch id ### Testing Strategy This pull request was tested using an STM32F412G Discovery board. ### TODO or Help Wanted N/A ### Documentation Updated - [x] Updated the relevant files in `/docs`, or no updates are required. ### Formatting - [x] Ran `make prepush`. Co-authored-by: Alexandru Radovici <[email protected]> Co-authored-by: Vochescu Alexandru <[email protected]>
Pull Request Overview
This pull request fixes:
Testing Strategy
This pull request was tested using an STM32F412G Discovery board.
TODO or Help Wanted
N/A
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.