Skip to content

Commit fc26efc

Browse files
committed
drivers: display: stm32_ltdc: mask irq if necessary
LTDC interrupt routine is used to reload frame buffer pointer once full frame is finished flushing. As long as there is no need to change buffer - there is no need to disturb CPU. Thus: Enable LTDC interrupt only when new buffer is pending Signed-off-by: Pavlo Hamov <[email protected]>
1 parent 6e7756a commit fc26efc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/display/display_stm32_ltdc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,13 @@ static int stm32_ltdc_write(const struct device *dev, const uint16_t x,
223223

224224
data->pend_buf = pend_buf;
225225

226+
__HAL_LTDC_CLEAR_FLAG(&data->hltdc, LTDC_FLAG_LI);
227+
__HAL_LTDC_ENABLE_IT(&data->hltdc, LTDC_IT_LI);
228+
226229
k_sem_take(&data->sem, K_FOREVER);
227230

231+
__HAL_LTDC_DISABLE_IT(&data->hltdc, LTDC_IT_LI);
232+
228233
return 0;
229234
}
230235

@@ -479,7 +484,6 @@ static int stm32_ltdc_init(const struct device *dev)
479484
LTDC->LIPCR = 0U;
480485

481486
__HAL_LTDC_CLEAR_FLAG(&data->hltdc, LTDC_FLAG_LI);
482-
__HAL_LTDC_ENABLE_IT(&data->hltdc, LTDC_IT_LI);
483487

484488
return 0;
485489
}

0 commit comments

Comments
 (0)