 volatile bool haveData = false;
 volatile bool bbutton_up_isr = false;
 volatile bool bbutton_downp_isr = false;
+bool dataUpdated = false;
 
 unsigned long duration;
 

  Serial.begin(115200);
  Serial.flush();

  Serial.println("Starting....");

  Wire.begin(I2C_SLAVE_ADDR);
  Wire.onRequest(requestEvent);


void loop()
{
  if (!bbutton_up_isr)
  {
    if ((millis() - startMiils) > 500)
    {
      detachInterrupt(digitalPinToInterrupt(BUTTON_INT));
      duration = 500;
      bbutton_up_isr = true;
    }
  }
  else
  {
    if (!dataUpdated)
    {
      if (duration < 500)
      {
        pir_interuptCount = 1;
      }
      else
      {
        pir_interuptCount = 2;
      }
      device_pro.button = pir_interuptCount;
      device_pro.hash = calc_hash(device_pro);

      Serial.print("device_pro.button: ");
      Serial.println(device_pro.button);
      dataUpdated = true;
    }
  }

  if (haveData)
  {
    Serial.println("Got msg");
