Skip to content
Merged
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
11 changes: 6 additions & 5 deletions drivers/interrupt_controller/intc_wch_pfic.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,24 @@
#include <zephyr/init.h>
#include <zephyr/irq.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util.h>

#define SEVONPEND (1 << 4)
#define WFITOWFE (1 << 3)
#define SEVONPEND BIT(4)
#define WFITOWFE BIT(3)

void arch_irq_enable(unsigned int irq)
{
PFIC->IENR[irq / 32] = 1 << (irq % 32);
PFIC->IENR[irq / 32] = BIT(irq % 32);
}

void arch_irq_disable(unsigned int irq)
{
PFIC->IRER[irq / 32] |= 1 << (irq % 32);
PFIC->IRER[irq / 32] = BIT(irq % 32);
}

int arch_irq_is_enabled(unsigned int irq)
{
return ((PFIC->ISR[irq >> 5] & (1 << (irq & 0x1F))) != 0);
return ((PFIC->ISR[irq >> 5] & BIT(irq & 0x1F)) != 0);
}

static int pfic_init(void)
Expand Down
Loading