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

Haptic driver refactoring #3903

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Haptic driver refactoring #3903

merged 1 commit into from
Jun 19, 2024

Conversation

cepetr
Copy link
Contributor

@cepetr cepetr commented Jun 5, 2024

This PR focuses on refactoring the haptic controller driver. It does not fix any problems or introduce new features, but includes the following changes:

  1. Removed haptic_calibrate() since it's unused, and using calibration requires more effort than just having this routine.
  2. Removed the HAPTIC_ALERT effect since it's unused.
  3. Polished the haptic driver API (haptic.h). Added the haptic_deinit() function, allowing repeated driver initialization and deinitialization, and ensured all functions that can fail return bool.
  4. Refactored the driver to avoid using many global variables, resulting in the driver state being clear and well-defined in a single location.

The original goal was to prepare the haptic driver for power management features (e.g., suspending before entering low power modes and resuming after returning to full power).

@cepetr cepetr requested a review from TychoVrahe June 5, 2024 14:22
@cepetr cepetr self-assigned this Jun 5, 2024
@cepetr cepetr requested a review from prusnak as a code owner June 5, 2024 14:22
@cepetr cepetr added the T3T1 Trezor Safe 5 label Jun 5, 2024
@cepetr cepetr force-pushed the cepetr/low-power-touch branch from e9f6dca to 266a436 Compare June 12, 2024 12:00
@cepetr cepetr requested a review from matejcik as a code owner June 12, 2024 12:00
@cepetr cepetr force-pushed the cepetr/low-power-haptic branch from 5aeb473 to 715a817 Compare June 12, 2024 12:00
@cepetr cepetr force-pushed the cepetr/low-power-touch branch 2 times, most recently from 8f539c7 to a87c8bf Compare June 14, 2024 12:48
@cepetr cepetr force-pushed the cepetr/low-power-haptic branch from 715a817 to 450eed6 Compare June 14, 2024 12:48
@cepetr cepetr force-pushed the cepetr/low-power-touch branch from 50f67d5 to c03a3df Compare June 18, 2024 08:57
@cepetr cepetr force-pushed the cepetr/low-power-haptic branch from 0d4c7c4 to 05feaa1 Compare June 18, 2024 08:57
@cepetr cepetr force-pushed the cepetr/low-power-touch branch 2 times, most recently from 6c77b40 to e25ade5 Compare June 19, 2024 08:45
@cepetr cepetr force-pushed the cepetr/low-power-haptic branch from 05feaa1 to 3aa64bc Compare June 19, 2024 08:46
@cepetr cepetr force-pushed the cepetr/low-power-touch branch 2 times, most recently from b54306e to 2723ee1 Compare June 19, 2024 10:00
@cepetr cepetr force-pushed the cepetr/low-power-haptic branch from 3aa64bc to f8c77b0 Compare June 19, 2024 10:01
Base automatically changed from cepetr/low-power-touch to main June 19, 2024 12:03
@cepetr cepetr force-pushed the cepetr/low-power-haptic branch from f8c77b0 to 1c262fd Compare June 19, 2024 12:04
@cepetr cepetr merged commit bfedb96 into main Jun 19, 2024
33 of 34 checks passed
@cepetr cepetr deleted the cepetr/low-power-haptic branch June 19, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T3T1 Trezor Safe 5
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants