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

extmod/modbluetooth: Prioritise non-scan-result events. #5328

Closed
wants to merge 2 commits into from

Conversation

jimmo
Copy link
Member

@jimmo jimmo commented Nov 13, 2019

When a scan is in progress, the ring buffer can fill up and be saturated with scan result events. As intended, the extra events are dropped. But this isn't great for other events which ideally should take priority over the scan results.

This PR changes the enqueue behavior so that non-scan-result events can remove other scan-result events from the ringbuffer and take their place.

Remove existing scan result events from the ringbuf if the ringbuf is
full and we're trying to enqueue any other event.
@dpgeorge
Copy link
Member

Thank you! I've tested this and it works well.

@dpgeorge
Copy link
Member

Merged in 4f96689 and 334ba01

@dpgeorge dpgeorge closed this Nov 21, 2019
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants