- #include "includes.h"
- void IRQInit(void)
- {
- //设置GPIO为IRQ功能
- MCF_GPIO_PNQPAR = 0
- | MCF_GPIO_PNQPAR_IRQ1_IRQ1
- | MCF_GPIO_PNQPAR_IRQ7_IRQ7;
- //设置为检测上升沿
- MCF_EPORT0_EPPAR = 0
- | MCF_EPORT_EPPAR_EPPA1_RISING
- | MCF_EPORT_EPPAR_EPPA7_RISING;
- //自身开放中断
- MCF_EPORT0_EPIER = 0
- | MCF_EPORT_EPIER_EPIE1
- | MCF_EPORT_EPIER_EPIE7;
- //在总的中断控制器中开放IRQ中断
- MCF_INTC0_IMRL &= ~(0
- | MCF_INTC_IMRL_INT_MASK1
- | MCF_INTC_IMRL_INT_MASK7
- | MCF_INTC_IMRL_MASKALL);
- }