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

The Things Node button release does not provide time pressed #9

Closed
pe1mew opened this issue Nov 14, 2017 · 4 comments
Closed

The Things Node button release does not provide time pressed #9

pe1mew opened this issue Nov 14, 2017 · 4 comments
Assignees

Comments

@pe1mew
Copy link

pe1mew commented Nov 14, 2017

The function onButtonRelease() is not delivering the time the button is pressed.
it is always 0.

@johanstokking
Copy link
Member

Thanks for reporting. I'm not seeing any obvious errors in the code. You do get the button press callback, right?

Is this behavior consistent?

@pe1mew
Copy link
Author

pe1mew commented Nov 17, 2017

No, I do not get the button press call back, but: after i pressed the button I do get the button release call back. when I release I get no call back

@hallard
Copy link
Contributor

hallard commented Feb 12, 2018

@johanstokking IRQ management on this type of devices are sometimes tricky, anyway I think I fixed the issue while trying low power mode

  • First do not sleep while the button is pressed (this may stop the ms timer) and return wrong values of duration
  • IRQ are fired quickly, and since there is no debounce on button, we need to check that main loop has seen (ACK) the press detected before seeing and doing any release job.
  • also it's best to declare any var used in IRQ as volatile to avoid race condition

Just let me know if it just works

@hallard
Copy link
Contributor

hallard commented Mar 1, 2018

Should also be fixed in #15

@pe1mew pe1mew closed this as completed Mar 23, 2018
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

No branches or pull requests

3 participants