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

Bangle.getPressure() redesign #2447

Merged
merged 4 commits into from
Jan 17, 2024
Merged

Bangle.getPressure() redesign #2447

merged 4 commits into from
Jan 17, 2024

Conversation

d3nd3
Copy link
Contributor

@d3nd3 d3nd3 commented Jan 13, 2024

Fixes #2445

I decided to keep the timeout as the comments suggest there need to be a minimum delay after turning on. But still utilized the code in the periPollHandler to resolve the promise.

@d3nd3 d3nd3 force-pushed the barofix branch 2 times, most recently from 076dba0 to 1b1e3ad Compare January 14, 2024 00:25
@d3nd3
Copy link
Contributor Author

d3nd3 commented Jan 14, 2024

You have a choice whether a Bangle.on("pressure") callback fires from a Bangle.getPressure(), currently it does.

@d3nd3
Copy link
Contributor Author

d3nd3 commented Jan 14, 2024

Okay. I am fairly happy with the code.

  • When Bangle.setBarometerPower(1) is set prior to using Bangle.getPressure(), it has fast response as described in the docs, albeit the value isn't 'fresh' necessarily, as expected.
  • If user uses streaming Bangle.on("pressure'), he gets 'fresh' values, they come as fast as they can whilst being fresh.
  • Decide if you like it that Bangle.on("pressure") triggers during the temporary activation during Bangle.getPressure().

Feedback welcome.

@gfwilliams
Copy link
Member

Thanks - I'll post some comments in the issue...

@gfwilliams gfwilliams merged commit fb2d3a1 into espruino:master Jan 17, 2024
15 checks passed
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.

Bangle.getPressure() fails intermittently
2 participants