Skip to content

Commit

Permalink
fixup! feat(core/embed): prepare backlight driver for low power mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cepetr committed Jun 19, 2024
1 parent 17ed47a commit fb87cc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/embed/trezorhal/stm32f4/backlight_pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typedef struct {
// Set if driver is initialized
bool initialized;
// Current backlight level in range 0-255
backlight_level_t current_level;
int current_level;

} backlight_driver_t;

Expand All @@ -56,7 +56,7 @@ void backlight_pwm_init(backlight_action_t action) {

memset(drv, 0, sizeof(backlight_driver_t));

backlight_level_t initial_level = 0;
int initial_level = 0;

if (action == BACKLIGHT_RETAIN) {
// We expect the BACKLIGHT_PWM_TIM to be already initialized
Expand Down
7 changes: 2 additions & 5 deletions core/embed/trezorhal/stm32f4/backlight_pwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#ifndef TREZORHAL_BACKLIGHT_H
#define TREZORHAL_BACKLIGHT_H

// Level of backlight in range 0-255
typedef int backlight_level_t;

// Action to be taken when initializing or
// deinitializing the backlight driver
typedef enum {
Expand Down Expand Up @@ -50,11 +47,11 @@ void backlight_pwm_deinit(backlight_action_t action);
// If the level is outside the range, the function has no effect
// and just returns the actual level set. If the backlight driver
// is not initialized, the function returns 0.
backlight_level_t backlight_pwm_set(backlight_level_t val);
int backlight_pwm_set(int val);

// Gets the backlight level in range 0-255
//
// Returns 0 if the backlight driver is not initialized.
backlight_level_t backlight_pwm_get(void);
int backlight_pwm_get(void);

#endif // TREZORHAL_BACKLIGHT_H

0 comments on commit fb87cc9

Please sign in to comment.