3 Replies Latest reply on Jun 14, 2017 10:22 AM by mario.pro2_1603066

    Problem with 2 interrupts at the same time




      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){
                  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?