LedgerHQ / ledger-device-rust-sdk

Rust SDK for Ledger device applications
Apache License 2.0
44 stars 29 forks source link

rework MultiFieldReview to use less stack #120

Closed yhql closed 8 months ago

yhql commented 8 months ago

Preallocating 48 Pages led to a huge stack usage and to crashes on Nano S. This gadget was reworked so that it does not preallocate, and makes it "simpler" to visualize Fields by giving them their own widget (similar to MessageScroller in behaviour, except with a counter and a different amount of lines used).

Note that MAX_LINES was changed to 4 (was previously 3) for Nano X/S+ to avoid ifdefs to match the C version of the Field view, but as a consequence, a Menu now displays over 4 lines.

yogh333 commented 8 months ago

FYI I have tested this branch with app-boilerplate-rust (see here) and all tests are OK (with --golden_run option as some snapshots are modified due to this). And good news, all tests still OK with the last nightly (17/01/2024).