-
-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error handling / RSOD screen #3938
Conversation
|
dd3e4c2
to
ae7618d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice. OK from me, someone else should also look at it from embedded POV.
while you're at this, maybe you would like to look at #744 ? (not required for this PR but it might be an opportunity to fold it in)
It looks like |
yeah, exactly. |
I made the changes in commit af45de2:
|
Aaaa, I didn't notice that. So I reverted this change here. In this file, it seems better to be consistent and not introduce a call to |
it's helpful if you post in your own comment, instead of editing mine :) otherwise, all good from my side |
[no changelog]
[no changelog]
This PR improves error handling in both C and Rust code:
and finally saves about 12KB of FLASH (without affecting the functionality)
common.c
/common.h
and moved to the platform-independentlib/error_handling.h
/.c
.error_shutdown()
.show_pin_too_many_screen()
andshow_wipe_code_screen()
.error_shutdown()
and introducederror_shutdown_ex()
for more complex cases.__fatal_error()
witherror_shutdown()
as the former is low-level and private toerror_handling.c
.show_install_restricted_screen()
to a more appropriate location (fromsecret.c
toerror_handling.c
).error_shutdown()
function, eliminating dual implementations in Rust and C.render_on_display
when an error occurred during drawing on the T3T1 model.dbg_trace!
macro, aprint!
-like macro for printing to the debug console.ensure!
,unwrap!
, andfatal_error!
.panic!
by callsto fatal_error!
.fatal_error!
has now just single parameter -message
assert()
andensure()
macro to not print evaluated expression and filename with full path.IMPORTANT: Unfortunately, (12) triggered a wave of changes in storage and legacy code, just because of the shared prototype of
__fatal_error()
. All affected code was changed appropriately, and as a result, the T1 model no longer reports the expression and function name on the fatal error screen (there's just the file and line - which is still more than on other models).