Commit 4b847348 authored by Mateusz Zalega's avatar Mateusz Zalega
Browse files

faultscreen: coding style


Signed-off-by: Mateusz Zalega's avatarMateusz Zalega <mateusz@appliedsourcery.com>
parent 16dda79a
......@@ -22,12 +22,10 @@ struct regs_t {
"ldr %0, [sp, #24] \n" \
"ldr %1, [sp, #20] \n" \
"mov %2, sp \n" \
: "=r" (regs.pc), \
"=r" (regs.lr), \
"=r" (regs.sp) \
)
: "=r"(regs.pc), "=r"(regs.lr), "=r"(regs.sp))
static void generic_handler(const char *reason) {
static void generic_handler(const char *reason)
{
char lines[3][64];
Core1_Stop();
......@@ -37,8 +35,16 @@ static void generic_handler(const char *reason) {
snprintf(lines[1], sizeof(lines[1]), "sp: 0x%08x", regs.sp);
snprintf(lines[2], sizeof(lines[2]), "lr: 0x%08x", regs.lr);
gfx_copy_region(&display_screen, 0, 0, 160, 80, GFX_RLE_MONO,
faultsplash_rle_len, faultsplash_rle);
gfx_copy_region(
&display_screen,
0,
0,
160,
80,
GFX_RLE_MONO,
faultsplash_rle_len,
faultsplash_rle
);
Color black = gfx_color(&display_screen, BLACK);
Color white = gfx_color(&display_screen, WHITE);
......@@ -50,32 +56,38 @@ static void generic_handler(const char *reason) {
gfx_update(&display_screen);
}
static void NMI_Handler_(void) {
static void NMI_Handler_(void)
{
LOAD_REGS();
generic_handler("NMI Fault");
}
static void HardFault_Handler_(void) {
static void HardFault_Handler_(void)
{
LOAD_REGS();
generic_handler("HardFault");
}
static void MemManage_Handler_(void) {
static void MemManage_Handler_(void)
{
LOAD_REGS();
generic_handler("MemMgmtFault");
}
static void BusFault_Handler_(void) {
static void BusFault_Handler_(void)
{
LOAD_REGS();
generic_handler("BusFault");
}
static void UsageFault_Handler_(void) {
static void UsageFault_Handler_(void)
{
LOAD_REGS();
generic_handler("UsageFault");
}
void card10_set_fault_handlers(void) {
void card10_set_fault_handlers(void)
{
NVIC_SetVector(NonMaskableInt_IRQn, NMI_Handler_);
NVIC_SetVector(HardFault_IRQn, HardFault_Handler_);
NVIC_SetVector(MemoryManagement_IRQn, MemManage_Handler_);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment