Quantcast
Channel: Cypress Semiconductor - PSoC 4 Architecture
Viewing all articles
Browse latest Browse all 796

Problem with 2 interrupts at the same time

$
0
0

Hello,

I have a problem with my interrupts. First of them appears every 30 seconds (it's interrupt on timer), and the second appears when there is a "1" on one of the pins. The problem is that both of them triggers the same function, so I would like to have some kind of protection to be sure that when one of the interrupt already triggered this action, the other won't do that, because it's pointless and it causes troubles. How can I achieve that? I tried with :

if((flag_interruptclock == 1) && (flag_pir == 1)){
            flag_conflict = 1;
        }
        for (i = 0; i < CMD_BUFF_LEN; i++) buffer[i] = 0;   
        if ((flag_interruptclock == 1) || (flag_pir == 1))
        {
            if(flag_conflict == 0){
            WIFI_SEND();
            flag_interruptclock = 0;
            flag_pir = 0;
            }
        }

but now it never triggers WIFI_SEND. I'm not sure what am I doing wrong. I'm attaching my whole project. Could anyone give me a hand?


Viewing all articles
Browse latest Browse all 796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>