I am using Olimex AT91SAM7S256 demo board and the package from Crossworks to build sample project. The purpose of the sample project is to test the button interrupt of AT91SAM7S256 MCU. I use some code from led and interrupt package, and the program is supposed to go in this way, when user click a button, the green LED turns on and off and then yellow LED turns on and off. I changed one part of the the code in ctl_olimex_sam7_p64.c,
//ctl_set_isr(PIOA_ID, 0, CTL_ISR_TRIGGER_LOW_LEVEL, buttonISR_PIOA, 0);
ctl_set_isr(PIOA_ID, 0, CTL_ISR_TRIGGER_POSITIVE_EDGE, buttonISR_PIOA, 0);
Because I want the interrupt occurs only once when clicking the button. However, the LEDs turns on and off TWICE.
In debug, I can see the PC stops within the buttonPressed() twice as I press one button.
Can anybody give me some idea how this does not work as I expected. Thank you very much!
Please sign in to leave a comment.