   } else {
     return false;
   }
-  //delayMicroseconds(5);
-  //attachInterrupt(digitalPinToInterrupt(DATA_IS_RDY_PIN), data_isr, RISING);
 }
 
 void setup() {


void data_isr() {
  bdata_is_rdy = digitalRead(DATA_IS_RDY_PIN);
}

void ICACHE_RAM_ATTR sendUdpSyslog(String msgtosend) {

  sendUdpSyslog(syslogPayload);
}

void ICACHE_RAM_ATTR sendtoInfluxdb() {
  String udppayload = "emontxv2,device=esp-01 ";
  udppayload += "F=";
  udppayload += ESP.getCpuFreqMHz();
  udppayload += "i,pls_no=";
  udppayload += sensor_data.pls_no;
  udppayload += "i,pls_ts=";
  udppayload += sensor_data.pls_ts;
  udppayload += "i,pls_p=";
  udppayload += pls_p;
  udppayload += "i,ct1_rp=";
  udppayload += sensor_data.ct1_rp;
  udppayload += "i,ct1_ap=";
  udppayload += sensor_data.ct1_ap;
  udppayload += "i,ct1_vr=";
  udppayload += sensor_data.ct1_vr;
  udppayload += "i,ct1_ir=";
  udppayload += sensor_data.ct1_ir;
  udppayload += "i,ct2_rp=";
  udppayload += sensor_data.ct2_rp;
  udppayload += "i,ct3_rp=";
  udppayload += sensor_data.ct3_rp;
  udppayload += "i,door=";
  udppayload += sensor_data.door;
  udppayload += "i";

  sendUdpmsg(udppayload);
}

bool ICACHE_RAM_ATTR get_i2c_data() {
  if (digitalRead(DATA_IS_RDY_PIN)) {
    pinMode(DATA_IS_RDY_PIN, OUTPUT);
    digitalWrite(DATA_IS_RDY_PIN, LOW);
