[fpc-pascal] Variable alignment in arm-embedded

Koenraad Lelong fpascal at brouwerij.homelinux.net
Tue Jun 26 12:22:33 CEST 2012


On 26-06-12 09:38, alrieckert wrote:
> Thank you for the feedback, does this mean you got the interrupt working
> with my patches??
Hi Anton,

Yes, I got interrupts working now.
It took some experimenting though. Or maybe I'm missing something. To 
get the interrupt procedure on the right place in the vector table you 
need to add an offset to the constant :

procedure Exti0_Proc; interrupt EXTI0_IRQn + 15;

But to enable the interrupt you have to use the constant itself :

NVIC_EnableIRQ(EXTI0_IRQn); // enable interrupt from rot.sensor

Maybe adding some constants for the place in the vector table would be 
better ?

P.S. Did you work already with interrupts ? I found I needed to clear 
the "Pending" bit of the interrupt at the end of the interrupt-routine. 
Otherwise I never left the interrupt-routine, or so it seemed. I tried 
with event-mode but that seemed no solution.

GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource0);
EXTI_StructInit(EXTI_InitStructure);
EXTI_InitStructure.EXTI_Trigger:=EXTI_Trigger_Rising_Falling;
EXTI_InitStructure.EXTI_Line:=EXTI_Line0;
EXTI_InitStructure.EXTI_LineCmd:=ENABLED;
//EXTI_InitStructure.EXTI_Mode:=EXTI_Mode_Event;
EXTI_Init(EXTI_InitStructure);

Regards,

Koen.



More information about the fpc-pascal mailing list