feat(epicardium): Add a panic() function
In unrecoverable situations we should provide a common way to output the cause of the error and then reset the CPU. The panic() function is mean to be exactly that. It outputs the error-cause, stack-trace, and firmware revision, accompanied by a link to the issue-tracker to encourage people to report the error. After a timeout of ~1.5s it resets the CPU and reboots. Future Work: - Right now, the stack-trace only has a depth of one which is the return address from where panic() was called. In the future it might make sense to provide a deeper stack-trace if a robust implementation is possible. - Integration of @msgctl's faultscreen (!79) so users who don't have the serial console open at all times can also see what happened. Signed-off-by:Rahix <rahix@rahix.de>
epicardium/modules/panic.c
0 → 100644
Please register or sign in to comment