Use integer progress fractions#1959
Open
benma wants to merge 5 commits into
Open
Conversation
Draft
benma
commented
Apr 23, 2026
Collaborator
Author
|
Added two more commits with small fixes, PTAL @cedwies |
cedwies
requested changes
May 18, 2026
| (input_index as f32 + subprogress) * step | ||
| }); | ||
| progress_component.set_fraction( | ||
| input_index * prevtx_total_ios + prevtx_input_index, |
Collaborator
There was a problem hiding this comment.
You already fixed the wrap around in C by using int64 instead of int32. What about here in rust?
Collaborator
Author
There was a problem hiding this comment.
If we change params from u32 to u64 here, then in C it could overflow uint64_t 😂
Since no one is expected to run into this, I converted it to checked arithmetic that fails on overflow. See new commit.
Add an integer `set_fraction()` progress path through the HAL and UI layers,
and switch the live Bitcoin-signing and Bluetooth-upgrade progress updates to
use it.
The progress bar ultimately renders whole pixels, so the C progress component
now stores the filled pixel width directly and computes it with integer math.
This keeps the visible behavior intact while removing the Rust-side soft-float
`f32` arithmetic path that was only used for progress updates.
In the final firmware image this drops the live
`compiler_builtins::float::{add,div,mul}::<f32>` helpers together with the
associated `__aeabi_fadd`, `__aeabi_fdiv`, and `__aeabi_fmul` wrappers.
Savings: 1352 bytes
Extend .ci/check-unwanted-symbols with additional checks for linked floating-point helpers in build/bin/firmware.elf. Keep the existing float formatting, strftime, and sha2::Sha512 checks, and add floating-point helper checks for the helpers removed by the integer fee and progress commits. The f64 check is intentionally scoped to comparison/conversion helpers because this branch still has some double arithmetic helpers pulled in by the existing C snprintf/newlib path.
Compute the filled pixel width with a 64-bit product so large valid fractions cannot wrap before division.
Render filled progress pixels within the inclusive screen bounds and skip drawing when the filled width is zero.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.