mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 11:28:14 +00:00
trezor.utils.halt: print error message passed as argument
This commit is contained in:
parent
533aebdf6d
commit
41cd3d71d5
@ -61,6 +61,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUtils_memcpy_obj, 5, 5, mod
|
||||
/// Halts execution
|
||||
/// '''
|
||||
STATIC mp_obj_t mod_TrezorUtils_halt(size_t n_args, const mp_obj_t *args) {
|
||||
mp_buffer_info_t msg;
|
||||
if (n_args > 0 && mp_get_buffer(args[0], &msg, MP_BUFFER_READ)) {
|
||||
printf("HALT! %s\n", (const char *)msg.buf);
|
||||
} else {
|
||||
printf("HALT!\n");
|
||||
}
|
||||
// TODO: is this the best we can do?
|
||||
#if defined STM32_HAL_H
|
||||
// loop forever
|
||||
|
Loading…
Reference in New Issue
Block a user