Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

alexandruradovici
Copy link
Contributor

@alexandruradovici alexandruradovici commented Dec 30, 2020

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

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

@phil-levis phil-levis added the tock-2.0 Issues and PRs related to Tock version 2.0. label Dec 30, 2020
Copy link
Contributor

@phil-levis phil-levis left a 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);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@phil-levis
Copy link
Contributor

bors r+

@bors bors bot merged commit e6251b1 into tock:tock-2.0-dev Dec 31, 2020
@bors
Copy link
Contributor

bors bot commented Dec 31, 2020

lschuermann pushed a commit to lschuermann/tock that referenced this pull request Mar 20, 2021
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tock-2.0 Issues and PRs related to Tock version 2.0.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants