drivers: intc_wch_pfic: replace shift operations with BIT macro
Updated intc_wch_pfic driver to use BIT() macro for clarity. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
parent
b15f942684
commit
aa8386929e
1 changed files with 6 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue