Skip to content

Add two-phase resource init and exports#580

Merged
gbin merged 2 commits into
masterfrom
gbin/2phase-resources
Dec 26, 2025
Merged

Add two-phase resource init and exports#580
gbin merged 2 commits into
masterfrom
gbin/2phase-resources

Conversation

@gbin

@gbin gbin commented Dec 26, 2025

Copy link
Copy Markdown
Collaborator

I ran into a chicken and egg problem on embedded with the resources.
You want to be able to log early so you need the SDCard initialized, but if you want to set up a board with SPI buses etc, the SDCard needs it ... but it is only created at application time.

So I moved the app init in 2 phases: one for the resources you then one for the tasks.

By default, both are done at the same time but you can use this alternative to create a proper custom logger matching your app from your hw before actually starting the app.

@gbin gbin merged commit 173eff0 into master Dec 26, 2025
7 checks passed
@gbin gbin deleted the gbin/2phase-resources branch December 26, 2025 19:45
@makeecat makeecat added the bug Something isn't working label Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants