espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.76k stars 743 forks source link

Bangle.getPressure() redesign #2447

Closed d3nd3 closed 8 months ago

d3nd3 commented 8 months ago

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 commented 8 months ago

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

d3nd3 commented 8 months ago

Okay. I am fairly happy with the code.

Feedback welcome.

gfwilliams commented 8 months ago

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