From f0255661ed6a980b9d5ba54eb0a93bfaaa096118 Mon Sep 17 00:00:00 2001 From: Saleem Rashid Date: Sun, 11 Feb 2018 22:09:36 +0000 Subject: [PATCH] setup: Change fault handler wording --- setup.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/setup.c b/setup.c index 5adff947e..28a9fc600 100644 --- a/setup.c +++ b/setup.c @@ -29,18 +29,20 @@ uint32_t __stack_chk_guard; -void __attribute__((noreturn)) __stack_chk_fail(void) -{ - layoutDialog(&bmp_icon_error, NULL, NULL, NULL, "Stack smashing", "detected.", NULL, "Please unplug", "the device.", NULL); +static inline void __attribute__((noreturn)) fault_handler(const char *line1) { + layoutDialog(&bmp_icon_error, NULL, NULL, NULL, line1, "detected.", NULL, "Unplug your TREZOR", "contact our support.", NULL); for (;;) {} // loop forever } +void __attribute__((noreturn)) __stack_chk_fail(void) { + fault_handler("Stack smashing"); +} + void nmi_handler(void) { // Clock Security System triggered NMI if ((RCC_CIR & RCC_CIR_CSSF) != 0) { - layoutDialog(&bmp_icon_error, NULL, NULL, NULL, "Clock instability", "detected.", NULL, "Please unplug", "the device.", NULL); - for (;;) {} // loop forever + fault_handler("Clock instability"); } }