Skip to content

Commit

Permalink
fixup! feat(core): display driver for T3W1
Browse files Browse the repository at this point in the history
  • Loading branch information
TychoVrahe committed Dec 12, 2024
1 parent 9f43410 commit ed548c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 4 additions & 5 deletions core/embed/io/display/ltdc_dsi/display_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static bool display_ltdc_config_layer(LTDC_HandleTypeDef *hltdc,
return HAL_LTDC_ConfigLayer(hltdc, &LayerCfg, LTDC_LAYER_1) == HAL_OK;
}

static bool display_ltdc_init(void) {
static bool display_ltdc_init(uint32_t fb_addr) {
display_driver_t *drv = &g_display_driver;

__HAL_RCC_LTDC_CLK_ENABLE();
Expand Down Expand Up @@ -256,8 +256,7 @@ static bool display_ltdc_init(void) {
return false;
}

return display_ltdc_config_layer(&drv->hlcd_ltdc,
display_fb_get_initial_addr());
return display_ltdc_config_layer(&drv->hlcd_ltdc, fb_addr);
}

bool display_set_fb(uint32_t fb_addr) {
Expand Down Expand Up @@ -312,7 +311,7 @@ void display_init(display_content_mode_t mode) {
backlight_pwm_init(BACKLIGHT_RESET);
#endif

display_fb_clear();
uint32_t fb_addr = display_fb_init();

__HAL_RCC_LTDC_RELEASE_RESET();
__HAL_RCC_DSI_RELEASE_RESET();
Expand All @@ -327,7 +326,7 @@ void display_init(display_content_mode_t mode) {
if (!display_dsi_init()) {
goto cleanup;
}
if (!display_ltdc_init()) {
if (!display_ltdc_init(fb_addr)) {
goto cleanup;
}

Expand Down
4 changes: 3 additions & 1 deletion core/embed/io/display/ltdc_dsi/display_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ void display_fb_clear(void) {
mpu_set_active_fb(NULL, 0);
}

uint32_t display_fb_get_initial_addr(void) {
uint32_t display_fb_init(void) {
display_fb_clear();

fb_queue_reset(&g_display_driver.empty_frames);
fb_queue_reset(&g_display_driver.ready_frames);

Expand Down
2 changes: 1 addition & 1 deletion core/embed/io/display/ltdc_dsi/display_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool display_set_fb(uint32_t fb_addr);

void display_fb_clear(void);

uint32_t display_fb_get_initial_addr(void);
uint32_t display_fb_init(void);

static inline uint32_t is_mode_exception(void) {
uint32_t isr_number = __get_IPSR() & IPSR_ISR_Msk;
Expand Down

0 comments on commit ed548c7

Please sign in to comment.