Skip to content

Commit

Permalink
fixup! refactor(core): improve dma2d driver init/deinit
Browse files Browse the repository at this point in the history
  • Loading branch information
cepetr committed Feb 10, 2025
1 parent 052c85a commit 7410636
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/embed/gfx/bitblt/stm32/dma2d_bitblt.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,22 @@ void dma2d_init(void) {
memset(drv, 0, sizeof(dma2d_driver_t));
drv->handle.Instance = DMA2D;

#ifdef KERNEL_MODE
__HAL_RCC_DMA2D_FORCE_RESET();
__HAL_RCC_DMA2D_RELEASE_RESET();
__HAL_RCC_DMA2D_CLK_ENABLE();
#endif
drv->initialized = true;
}

void dma2d_deinit(void) {
dma2d_driver_t* drv = &g_dma2d_driver;

#ifdef KERNEL_MODE
__HAL_RCC_DMA2D_CLK_DISABLE();
__HAL_RCC_DMA2D_FORCE_RESET();
__HAL_RCC_DMA2D_RELEASE_RESET();
#endif
memset(drv, 0, sizeof(dma2d_driver_t));
}

Expand Down
3 changes: 3 additions & 0 deletions core/embed/projects/firmware/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
#endif

int main(uint32_t cmd, void *arg) {
// This call will be removed in the future with DMA2D syscalls.
gfx_bitblt_init();

if (cmd == 1) {
systask_postmortem_t *info = (systask_postmortem_t *)arg;
rsod_gui(info);
Expand Down

0 comments on commit 7410636

Please sign in to comment.