Skip to content
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

Implement Button from scratch #37

Merged
merged 3 commits into from
Jun 3, 2021

Conversation

ikedam
Copy link
Contributor

@ikedam ikedam commented May 2, 2021

Re-implementation of Button from scratch as the current implementation of Button is licensed under CC BY-SA 3.0.
See #21 for more details.

This works as far as I tested on my m5paper.

I referred following documentations to implement this:

Reviewing diffs doesn't make sense at all as I started the development by removing those files

Please review following files:

* Return non-0 if now in PRESSED state and was in RELEASED state for more than `ms` milliseconds.
* @param ms milliseconds
* @return non-0 for pressed and was released for specified time.
*/
uint8_t wasReleasefor(uint32_t ms);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... as far as I created a simple sketch and compared the behaviors, the original wasReleasefor() looks return non-0 if in RELEASED state and was in PRESSED state for more than ms milliseconds.
It looks strange to me it tests the duration of PRESSED state but its name is wasReleasefor.

@Gitshaoxiang Gitshaoxiang merged commit 57b291f into m5stack:main Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants