Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 9 months ago.
__disable_irq()
Hi guys, I am working on my code which uses many different serial communication receiving interrupts. I am using disable_irq() to disable the interrupts when required and then enabling it.
My question is does it disable all the receiving interrupts running at the moment. If yes how can I disable specific interrupts.
Regards Kamil
3 Answers
10 years, 11 months ago.
Here you go
IRQ Demo
#include "mbed.h" DigitalOut myled(LED1); DigitalOut myled2(LED2); InterruptIn MyIRQ(p21); void LED_on_off_IRQ(void) { myled=!myled; // LED1 goes on or off every time p21 goes high. } int main() { while(1){ myled2=1; MyIRQ.rise(LED_on_off_IRQ); // calls LED_on_off_IRQ when p21 goes high wait(5); myled2=0; MyIRQ.rise(NULL); // stops the IRQ can't change LED1 state wait(5); } }
10 years, 11 months ago.
hi, can you give me an example of disable the interrupts when required and then enabling it.
please i have problems