Skip to content

Commit

Permalink
lvgl: nxp: pxp: Fix irq enablement for Zephyr
Browse files Browse the repository at this point in the history
For Zephyr RTOS, irq is not correctly enabled and disabled.
Fix it.

Signed-off-by: Farah Fliss <[email protected]>
Signed-off-by: Trung Hieu Le <[email protected]>
  • Loading branch information
0xFarahFl committed Apr 26, 2024
1 parent 2b498e6 commit e791770
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

#if defined(__ZEPHYR__)
#include <zephyr/kernel.h>
#include <zephyr/irq.h>
#endif

/*********************
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit e791770

Please sign in to comment.