From e791770ae4f9371346d03b5c1a271ad0a279bf9e Mon Sep 17 00:00:00 2001 From: Farah Fliss Date: Fri, 26 Apr 2024 17:05:36 +0200 Subject: [PATCH] lvgl: nxp: pxp: Fix irq enablement for Zephyr For Zephyr RTOS, irq is not correctly enabled and disabled. Fix it. Signed-off-by: Farah Fliss Signed-off-by: Trung Hieu Le --- src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c b/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c index b094928c5..417d15f71 100644 --- a/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c +++ b/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c @@ -44,6 +44,7 @@ #if defined(__ZEPHYR__) #include + #include #endif /********************* @@ -141,21 +142,25 @@ static lv_res_t _lv_gpu_nxp_pxp_interrupt_init(void) return LV_RES_INV; NVIC_SetPriority(LV_GPU_NXP_PXP_IRQ_ID, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 1); -#endif - s_pxpIdle = true; - NVIC_EnableIRQ(LV_GPU_NXP_PXP_IRQ_ID); +#elif defined(__ZEPHYR__) + IRQ_DIRECT_CONNECT(LV_GPU_NXP_PXP_IRQ_ID, CONFIG_DMA_INIT_PRIORITY, PXP_IRQHandler, 0); + irq_enable(LV_GPU_NXP_PXP_IRQ_ID); +#endif + + s_pxpIdle = true; return LV_RES_OK; } static void _lv_gpu_nxp_pxp_interrupt_deinit(void) { - NVIC_DisableIRQ(LV_GPU_NXP_PXP_IRQ_ID); #if defined(SDK_OS_FREE_RTOS) vSemaphoreDelete(s_pxpIdleSem); + NVIC_DisableIRQ(LV_GPU_NXP_PXP_IRQ_ID); #elif defined(__ZEPHYR__) k_sem_reset(&s_pxpIdleSem); + irq_disable(LV_GPU_NXP_PXP_IRQ_ID); #endif }