PowerBlocks SDK
 
Loading...
Searching...
No Matches
crash_handler.h File Reference

Used to display a crash screen for debugging. More...

Go to the source code of this file.

Typedefs

typedef void(* crash_handler_t) (const char *cause, exception_context_t *ctx)
 Function pointer to the system crash handlers.
 

Functions

void crash_handler_bug_check (const char *cause, exception_context_t *ctx)
 Freezes the system and displays a crash screen.
 
void crash_handler_set (crash_handler_t handler)
 Sets the system crash handler.
 

Detailed Description

Used to display a crash screen for debugging.

Provides a simple crash screen to aid with debugging.

Author
Samuel Fitzsimons (rainbain)
Date
2025

Typedef Documentation

◆ crash_handler_t

typedef void(* crash_handler_t) (const char *cause, exception_context_t *ctx)

Function pointer to the system crash handlers.

Function pointer to the system crash handlers. Used with crash_handler_set.

Parameters
causeThe Name / Cause of the Crash
ctxExecution context. If provided it can display register information and stack at the time.

Function Documentation

◆ crash_handler_bug_check()

void crash_handler_bug_check ( const char * cause,
exception_context_t * ctx )
extern

Freezes the system and displays a crash screen.

Freezes the system and displays a crash screen.

Calls the set crash handle function, or the default

The name bug check is a reference to the keBugCheck function that displays the BSOD in Windows.

Parameters
causeThe Name / Cause of the Crash
ctxExecution context. If provided it can display register information and stack at the time.

◆ crash_handler_set()

void crash_handler_set ( crash_handler_t handler)
extern

Sets the system crash handler.

Sets the system crash handler.

Set to NULL to put it to the default.

Look at the implementation of the default handler for an example of this. The handler can return and execution will attempt to continue.

Parameters
handlerFunction to handle the crash.