Skip to content
  • rahix's avatar
    feat(epicardium): Add a panic() function · 1536da34
    rahix authored
    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: default avatarRahix <rahix@rahix.de>
    1536da34