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

MEMORY_BUSY during BLE operations #1277

Closed
gfwilliams opened this issue Nov 16, 2017 · 2 comments
Closed

MEMORY_BUSY during BLE operations #1277

gfwilliams opened this issue Nov 16, 2017 · 2 comments
Labels

Comments

@gfwilliams
Copy link
Member

The current bluetooth implementation does a lot of things in IRQs (for instance promise resolution) that allocate variables - Espruino was never meant for that, and you can occasionally hit an issue where Espruino is unable to allocate a variable from an IRQ because it's doing GC in the main thread.

Not such an issue for advertising, but a deal-breaker during a promise.

I've spent a while trying to improve matters quite a lot, but at the end of the day it's almost unavoidable - so I want to move away from allocating JsVars, and to instead use the IO queue that we use for other events (eg BLE UART, Serial, Watches, etc).

gfwilliams added a commit that referenced this issue Dec 14, 2017
…avoid MEMORY_BUSY messages (#1277)

Use queue for NFC events too
@gfwilliams
Copy link
Member Author

This is mostly done now, but we need a way to push to and retrieve data from the IO queue, so we can move:

  • write and notify
  • connect (it has an address)
  • advertising (we currently use a static buffer, but that'll only hold one advertising packet)

@gfwilliams
Copy link
Member Author

Complete as of a month or so ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant