[fpc-pascal] Variable alignment in arm-embedded
alrieckert
anton at riecktron.co.za
Wed Jun 27 06:20:32 CEST 2012
Koenraad Lelong-2 wrote
>
> 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 ?
>
Yes, I forgot to mention that. I use it exactly like you have it with the +
15
Koenraad Lelong-2 wrote
>
> 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);
>
Yes, I'm using the following interrupts in one of my projects.
USART1, USART2, Systick, Timer1, Timer2, Timer3 and two of the EXTI
You need to enable the EXTI interrupt as well. Here is an example for EXTI1.
I haven't tried with Event mode yet. I'll give you feedback on this a bit
later. Maybe there is also a small problem with the ported library to
pascal?
and then you need
My interrupt procedure looks like follow
Thus far my projects are running without any problems or issues and the
interrupt are working great.
--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Variable-alignment-in-arm-embedded-tp5709962p5710183.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
More information about the fpc-pascal
mailing list