interrupts in FreeRTOS? I wanted to write a simple interrupt
routine that would toggle a led when I press a button. But sadly,
when I add the interrupt initialization code, the task won’t start.
Here’s the code:
void initInterr()
{
AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_PIOA, 5, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL,ChangeFlashRate);
AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_PIOA);
AT91C_BASE_PIOA->PIO_IER = AT91C_PIO_PA19; // B1
}
void vStartLEDFlashTasks()
{
initInterr();
xTaskCreate( vLEDBlink, ( signed char * ) "LEDtaskC", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 2, NULL );
}
void ChangeFlashRate()
{
int status;
status = AT91C_BASE_PIOA->PIO_ISR;
vParTestToggleLED( 0 );
}
As you can see it’s very simple. I’m using SAM7-P64 dev board. Am i doing it wrong?