-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Open
Labels
enhancementFeature requests, new feature implementationsFeature requests, new feature implementations
Description
Description
From #18446 (comment):
Side note - is there a way for user C/C++ modules to detect and respond to soft resets?
No, but that would be a good thing to add. Maybe something like
MP_REGISTER_SOFT_RESET_HOOK? That would add to an array of soft reset callbacks.
Would also be great to have hooks for initialization, similar to MICROPY_BOARD_STARTUP and MICROPY_BOARD_EARLY_INIT. Example for motivation, I have this module implementation that needs to know when the GC has been initialized so memory can be allocated in the C heap before, or in the GC pool after.
Code Size
Would have zero code side increase for builds that do not need this feature, can be optionally enabled.
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree
Metadata
Metadata
Assignees
Labels
enhancementFeature requests, new feature implementationsFeature requests, new feature implementations