Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pxp): hookup zephyr interrupts #6158

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 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 @@ -124,6 +125,13 @@ void PXP_IRQHandler(void)
}
}

#if defined(__ZEPHYR__)
static void PXP_ZephyrIRQHandler(void *)
{
PXP_IRQHandler();
}
#endif

lv_nxp_pxp_cfg_t * lv_gpu_nxp_pxp_get_cfg(void)
{
return &pxp_default_cfg;
Expand All @@ -141,21 +149,30 @@ 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_CONNECT(DT_IRQN(DT_NODELABEL(pxp)), CONFIG_LV_Z_PXP_INTERRUPT_PRIORITY, PXP_ZephyrIRQHandler, NULL, 0);
irq_enable(DT_IRQN(DT_NODELABEL(pxp)));
#else
NVIC_EnableIRQ(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);
faxe1008 marked this conversation as resolved.
Show resolved Hide resolved
#if defined(SDK_OS_FREE_RTOS)
NVIC_DisableIRQ(LV_GPU_NXP_PXP_IRQ_ID);
vSemaphoreDelete(s_pxpIdleSem);
#elif defined(__ZEPHYR__)
irq_disable(DT_IRQN(DT_NODELABEL(pxp)));
k_sem_reset(&s_pxpIdleSem);
#else
NVIC_DisableIRQ(LV_GPU_NXP_PXP_IRQ_ID);
#endif
}

Expand Down
Loading