 
 // interrupt counter is not bound very elegantly to
 // cntArr, I think about this later.
-volatile unsigned int _kwCounter = 0;   // counter for the number of interrupts
+int volatile *_counters;
+
 
 IPAddress ip(192,168,1,177);
 IPAddress gateway(192,168,1, 1);

  boolean ret=false;

  for (int i=0;i<(sizeof(cntArr) / sizeof(struct cnt));i++) {
    diff = abs(cntArr[i].measured.analog-cntArr[i].prevsnd.analog);
    limit = cntArr[i].diff.analog * (1.0 + cntArr[i].measured.analog * cntArr[i].diff_factor.analog);
    if (diff > limit) {
      cntArr[i].flags |= FLAGS_DATACHANGE;
      ret=true;
    }
  }
  return ret;

  setSyncProvider(getNtpTime);
  sched.every(1000,processSensors);
  sched.every(200,checkEthernet);
  _counters=(int *) malloc(sizeof(int) * sizeof(cntArr) / sizeof(struct cnt));
  for (int i=0;i<(sizeof(cntArr) / sizeof(struct cnt));i++) {
    if (cntArr[i].irqno!=-1) {
      cntArr[i].last_send=now();
      attachInterrupt(cntArr[i].irqno,cntArr[i].irqh, CHANGE);
    }
  }
}

void loop()
