1
0
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:
Pavol Rusnak 2016-11-19 15:30:46 +01:00
parent 533aebdf6d
commit 41cd3d71d5
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -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