Support two peripherals on F4 hubs #446
Closed
+279
−381
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This the follow up to #445 to enable more peripherals. This is only done for BTstack.
I think we can keep Technic/City/Move hub at one peripheral given their limitations.
The first commits are basically just replacing the
peripheral_singletonwith a pointer to an instance. The logic to make this possible was already done in #445.Perhaps the more interesting part for reviewing in this PR is this:
We are deleting the bonds every time so it's probably not necessary to have the lookup entries, but this isn't too expensive.
Bumping the HCI connections and GATT clients does need a fair bit of RAM, so this also does this:
14K works fine too. I picked 12K because we have that on Essential Hub too and it should still be far more than necessary. This should give us some room for static memory in future developments. (We could also reduce heap instead. We did increase it recently after all to have some heap left even if all slots are full.)