 unsigned long g_previous_millis = 0;
 // ledState used to set the LED
 int ledState = LOW;
+// Interrupt type
+int NO_INTERRUPT = 0;
+int DIAG_INTERRUPT = NO_INTERRUPT + 1;
+int DOOR_INTERRUPT = DIAG_INTERRUPT + 1;
+// Interrupt variable (used to know which interrupt was striggered in the loop)
+volatile int g_interrupt_id = NO_INTERRUPT;
+
+// Interrupt called when presing the diag switch
+void diagnoticInterrupt() {
+  g_interrupt_id = DIAG_INTERRUPT;
+}
+
+// Interrupt called when magentic switch change its state
+void doorInterrupt() {
+  g_interrupt_id = DOOR_INTERRUPT;
+}
 
 void setupRFDevice() {
   // Transmitter is connected to Arduino Pin #10


// Function called on door state change
void doorStateChange() {
  // Check contact state. We assume a normally closed switch.
  boolean newContact = (digitalRead(MAGNETIC_SWITCH_PIN) == HIGH);
  // Set the signaling LED

    }
    packet >>= 1;
  }
  // Send packet
  rfDevice.send(codeWord1);
  rfDevice.send(codeWord2);
