Home > other >  Button interrupt problem, bosses come in please
Button interrupt problem, bosses come in please

Time:09-16



1, C language KL26Z256 Chip, the Blue Chip - Blazar - bata experiment board, write interrupt external buttons, enter the interrupt the initialization, exit and then enter the interrupt, no error message
2, the initialization code:
Void main (void) {
SIM_SCGC5 |=((1 & lt; <9) + (1 & lt; <10));//PORTA, B clock

GPIOA_PDDR & amp;=~ 0 x83020;//on the left side of the multifunctional PTA19, 12,5,13 passage read

Asm (CPSIE "I");//the interrupt master switch

NVIC_ISER |=0 x40000000;//child PORTA interrupt switch

//drop along the trigger, configured to IO mouth, pull-up can make open
PORTA_PCR19=0 x0a0102;
PORTA_PCR5=0 x0a0102;
PORTA_PCR12=0 x0a0102;
PORTA_PCR13=0 x0a0102;
}
//external interrupt subroutine
Void PORTA_IRQHandler (void)
{
delay();//delay shake
//button set length add a
If ((GPIOA_PDIR & amp; {0 x80000)==0)
.
}
//remove the interrupt flag bit
PORTA_PCR1 |=0 x01000000;
PORTA_PCR5 |=0 x01000000;
PORTA_PCR12 |=0 x01000000;
PORTA_PCR13 |=0 x01000000;
}
3, for the first time to write, hope bosses forgive me to point out mistakes, thank you

CodePudding user response:

Interrupt a group and try again
  • Related