Re: [libopenstm32-devel] libopenstm32 exti interrupt
Status: Inactive
Brought to you by:
uh1763
|
From: Linus C. <li...@li...> - 2010-10-27 20:21:25
|
Found it!
Registers AFIO_EXTICRX are not well set.
file exti.c on line 130:
/* Ensure that only valid EXTI lines are used. */
if (exti < EXTI4) {
AFIO_EXTICR1 &= ~(0x000F << shift);
AFIO_EXTICR1 |= (~bits << shift);
} else if (exti < EXTI8) {
AFIO_EXTICR2 &= ~(0x000F << shift);
AFIO_EXTICR2 |= (~bits << shift);
} else if (exti < EXTI12) {
AFIO_EXTICR3 &= ~(0x000F << shift);
AFIO_EXTICR3 |= (~bits << shift);
} else if (exti < EXTI16) {
AFIO_EXTICR4 &= ~(0x000F << shift);
AFIO_EXTICR4 |= (~bits << shift);
}
Cheers,
Linus.
On Wed, Oct 27, 2010 at 3:03 PM, Linus Casassa <li...@li...> wrote:
> Hi Mark
>
> I can't make your code to work on PB0.
>
> I changed two lines:
> gpio_set_mode(GPIOB, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, GPIO0);
> and
> exti_select_source(EXTI0,GPIOB); //select PortB pin0 as interrupt source
>
> I connected PB0 to ground and when I press the button (PA0) the interrupt
> EXT0 executes...
>
> What am I missing?
>
> Thanks in advance.
>
> On Mon, Oct 11, 2010 at 12:18 AM, Mark Butler <mb...@ph...
> > wrote:
>
>> Hi,
>> Here is an example that works on the olimex stm32-p103
>>
>> If you are using c++, I have found that interrupt service routines must be
>> declared as extern c functions in order to get the correct function names
>> for the interrupt vector.
>>
>> I am currently using my own version of exti.c however I don't think it was
>> changed after I submitted to libopenstm32
>>
>> Feel free to ask if you have any questions.
>>
>> cheers,
>> Mark
>>
>>
>> On 09/10/10 05:52, Linus Casassa wrote:
>>
>>> Hi
>>>
>>> Thank you very much for your work on the lib libopenstm32. It has been
>>> very easy to program the stm32 chip. But I am having problems with the exti
>>> interrupt.
>>>
>>> Do you have an example of a button interrupting?
>>>
>>> Thanks in advance.
>>>
>>> --
>>> Linus Casassa
>>> Estudiante Ingeniería Civil Electrónica
>>> Universidad Técnica Federico Santa María
>>> Fono: 56-9-97776941
>>>
>>
>>
>
>
> --
> Linus Casassa
> Estudiante Ingeniería Civil Electrónica
> Universidad Técnica Federico Santa María
> Fono: 56-9-97776941
>
--
Linus Casassa
Estudiante Ingeniería Civil Electrónica
Universidad Técnica Federico Santa María
Fono: 56-9-97776941
|