Skip to content
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

refactor(core): improve random_delays api #4233

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Conversation

cepetr
Copy link
Contributor

@cepetr cepetr commented Oct 1, 2024

This small PR slightly improves the API of the random_delays module by making the function names more consistent.

It reflects the fact that random_delays serves two purposes:

  1. Provides a random generator for small delays that can be injected into any part of the code via the wait_random() function.
  2. Implements Random Delay Interrupts (RDI).

The wait_random() function was not renamed to avoid introducing extensive changes, especially in legacy code, as this PR aims to be minimally intrusive.

This PR resolves #4197, although it addresses the problem in a different way.

@cepetr cepetr added the core Trezor Core firmware. Runs on Trezor Model T and T2B1. label Oct 1, 2024
@cepetr cepetr requested a review from TychoVrahe October 1, 2024 09:07
@cepetr cepetr self-assigned this Oct 1, 2024
@cepetr cepetr requested a review from prusnak as a code owner October 1, 2024 09:07
Copy link

github-actions bot commented Oct 1, 2024

core UI changes device test click test persistence test
T2T1 Model T test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
T3B1 Safe 3 test(screens) main(screens) test(screens) main(screens) 2724
T3T1 test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
All main(screens)

core/embed/trezorhal/random_delays.h Outdated Show resolved Hide resolved
@cepetr cepetr merged commit 5eb5f8d into main Oct 7, 2024
85 checks passed
@cepetr cepetr deleted the cepetr/rdi-refactor branch October 7, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Trezor Core firmware. Runs on Trezor Model T and T2B1.
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

Improve consistency of names in random_delays module
2 participants