mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
use shutdown from startup.s
This commit is contained in:
parent
44bb5864d4
commit
c7af39bf8d
8
common.c
8
common.c
@ -22,15 +22,11 @@
|
||||
#include "rng.h"
|
||||
#include "layout.h"
|
||||
#include "oled.h"
|
||||
#include "util.h"
|
||||
#include "firmware/usb.h"
|
||||
|
||||
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) {
|
||||
const BITMAP *icon = &bmp_icon_error;
|
||||
char line[128] = {0};
|
||||
@ -63,13 +59,11 @@ void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg,
|
||||
oledRefresh();
|
||||
|
||||
shutdown();
|
||||
for (;;);
|
||||
}
|
||||
|
||||
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.");
|
||||
shutdown();
|
||||
for (;;);
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
1
util.h
1
util.h
@ -44,6 +44,7 @@ void data2hex(const void *data, uint32_t len, char *str);
|
||||
// read protobuf integer and advance pointer
|
||||
uint32_t readprotobufint(const uint8_t **ptr);
|
||||
|
||||
// defined in startup.s (or setup.c for emulator)
|
||||
extern void __attribute__((noreturn)) shutdown(void);
|
||||
|
||||
#if !EMULATOR
|
||||
|
Loading…
Reference in New Issue
Block a user