mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-02 04:18:20 +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 "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
1
util.h
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user