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

API refactor #851

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

API refactor #851

wants to merge 7 commits into from

Conversation

Daft-Freak
Copy link
Collaborator

Split the API struct into a "const" and "data" part. This is a result of me not wanting to reserve 2K of RAM on pico. After this, all the function pointers can be constants (may improve #484) and the data part only needs 64 bytes.

For compatibility, 32blit-stm32 is still using the old layout by inserting padding and overlaying the two structs on top of each other.

These are (I think) the only remaining non-pico changes on my big pico branch.

@Gadgetoid
Copy link
Contributor

In hindsight this makes an awful lot of sense.

Avoid device-specific memory things in the main library
I'd prefer to not allocate 2k of RAM for something that is mostly constants.

The STM32 parts are somewhat hacky
Might be usable in global initialisers... still undefined though.
Not needed elsewhere. Reduces RAM usage for the API to 64 bytes
These patches predate it, so add it to squash the warnings.
Same as the pico patch
@Daft-Freak
Copy link
Collaborator Author

Fixed warnings from these patches being older than can_launch and needed to rebase for recent build fixes.

I'll have to add the STM32 nastiness to the list of things that can be cleaned up if there's an API break... (Also, I should actually write that list)

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.

2 participants