1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-29 19:08:12 +00:00

use shutdown from startup.s

This commit is contained in:
Pavol Rusnak 2019-02-20 08:52:42 +01:00
parent 44bb5864d4
commit c7af39bf8d
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 2 additions and 7 deletions

View File

@ -22,15 +22,11 @@
#include "rng.h" #include "rng.h"
#include "layout.h" #include "layout.h"
#include "oled.h" #include "oled.h"
#include "util.h"
#include "firmware/usb.h" #include "firmware/usb.h"
uint8_t HW_ENTROPY_DATA[HW_ENTROPY_LEN]; uint8_t HW_ENTROPY_DATA[HW_ENTROPY_LEN];
static void __attribute__((noreturn)) shutdown(void)
{
for (;;);
}
void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line_num, const char *func) { void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line_num, const char *func) {
const BITMAP *icon = &bmp_icon_error; const BITMAP *icon = &bmp_icon_error;
char line[128] = {0}; char line[128] = {0};
@ -63,13 +59,11 @@ void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg,
oledRefresh(); oledRefresh();
shutdown(); shutdown();
for (;;);
} }
void __attribute__((noreturn)) error_shutdown(const char *line1, const char *line2, const char *line3, const char *line4) { void __attribute__((noreturn)) error_shutdown(const char *line1, const char *line2, const char *line3, const char *line4) {
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, line1, line2, line3, line4, "Please unplug", "the device."); layoutDialog(&bmp_icon_error, NULL, NULL, NULL, line1, line2, line3, line4, "Please unplug", "the device.");
shutdown(); shutdown();
for (;;);
} }
#ifndef NDEBUG #ifndef NDEBUG

1
util.h
View File

@ -44,6 +44,7 @@ void data2hex(const void *data, uint32_t len, char *str);
// read protobuf integer and advance pointer // read protobuf integer and advance pointer
uint32_t readprotobufint(const uint8_t **ptr); uint32_t readprotobufint(const uint8_t **ptr);
// defined in startup.s (or setup.c for emulator)
extern void __attribute__((noreturn)) shutdown(void); extern void __attribute__((noreturn)) shutdown(void);
#if !EMULATOR #if !EMULATOR