Quantcast
Viewing all articles
Browse latest Browse all 4933

SDK • Panic function

Hello everyone,

So I've now ported Lua a few times to run with the PicoSDK, There are some problems with this, like Lua calls a function named panic. This function is already used by the SDK normally I just rename it Panic and carry on from there.

Now with the SDK panic function I want to change it's behaviour. I don't necessarily want execution to just end.

For example Core 1 is running a video generator it would be useful if core 0 hits a panic for the message to display on with that generator. It would great if the panic message were to display with that generator. Is this possible to do? It would be great if when core one crashes it doesn't take core 1 with it.

I see in the SDK panic.c has this comment

Code:

// PICO_CONFIG: PICO_PANIC_FUNCTION, Name of a function to use in place of the stock panic function or empty string to simply breakpoint on panic, group=pico_runtime// note the default is not "panic" it is undefined
I don't know what exactly that means but I take it that I could remove the SDK panic function or define a new function like Pico_panic? How do I do this? It would be great if this would not break the entire SDK that calls panic and it ends up as a call to the Lua version

Statistics: Posted by DarkElvenAngel — Tue Jan 14, 2025 1:11 am



Viewing all articles
Browse latest Browse all 4933

Trending Articles