Код
#define PIO_INTERRUPT_LEVEL 6
int count_interrupt;
__ramfunc void pio_c_irq_handler ( void )
{
int dummy;
count_interrupt++;
dummy =AT91C_BASE_PIOA->PIO_ISR;
//* suppress the compilation warning
dummy =dummy;
}
int main( void )
//* Begin
{
unsigned int loop_count;
AT91PS_AIC pAic;
//* Load System pAic Base address
pAic = AT91C_BASE_AIC;
//* Enable User Reset and set its minimal assertion to 960 us
AT91C_BASE_RSTC->RSTC_RMR = AT91C_RSTC_URSTEN | (0x4<<8) | (unsigned int)(0xA5<<24);
// First, enable the clock of the PIOB
AT91F_PMC_EnablePeriphClock ( AT91C_BASE_PMC, 1 << AT91C_ID_PIOA );
AT91F_PIOA_CfgPMC();
//* open external PIO interrupt
//* define switch SW3 at PIO input for interrupt IRQ loop
AT91F_PIO_CfgInput(AT91C_BASE_PIOA, SW3_MASK | SW4_MASK);
AT91F_AIC_ConfigureIt ( pAic, AT91C_ID_PIOA, PIO_INTERRUPT_LEVEL,AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE, pio_c_irq_handler);
AT91F_PIO_InterruptEnable(AT91C_BASE_PIOA,SW4_MASK);
//* set the interrupt by software
AT91F_AIC_EnableIt (pAic, AT91C_ID_PIOA);
for (;;)
{
}
//* End
}
Все перепробовал а прерывания от перепада нету! SW4 это PA26 что не так