diff options
author | Damien George <damien@micropython.org> | 2025-03-06 23:29:58 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-04-09 00:22:32 +1000 |
commit | 7e32c232183441e1022f59e58c31ba431c25fe2f (patch) | |
tree | 4eab69a973c87f0d951395ffecde87f0c5a7b324 | |
parent | 68b1dae011dd9f2696e9f6f2f914317d827c879d (diff) |
alif/mpmetalport: Only notify after metal subsystem is init'd.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r-- | ports/alif/mpmetalport.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ports/alif/mpmetalport.c b/ports/alif/mpmetalport.c index b0a017fdd..9d774cb90 100644 --- a/ports/alif/mpmetalport.c +++ b/ports/alif/mpmetalport.c @@ -37,6 +37,8 @@ #include "se_services.h" struct metal_state _metal; + +static bool metal_active; static mp_sched_node_t rproc_notify_node; int metal_sys_init(const struct metal_init_params *params) { @@ -53,10 +55,13 @@ int metal_sys_init(const struct metal_init_params *params) { #endif metal_bus_register(&metal_generic_bus); + metal_active = true; + return 0; } void metal_sys_finish(void) { + metal_active = false; metal_bus_unregister(&metal_generic_bus); } @@ -91,6 +96,9 @@ int metal_rproc_notify(void *priv, uint32_t id) { } void metal_rproc_notified(void) { + if (!metal_active) { + return; + } // The remote core notified this core. mp_sched_schedule_node(&rproc_notify_node, openamp_remoteproc_notified); } |