 
 void enableTimer()
 {
-  noInterrupts();
   TIMSK1 |= (1 << TOIE1);
   intrReading = true;
   intrFirst = true;

  setupTimer();
  Serial.begin(115200);
  Serial.println("Start");
}

void setupTimer()

#endif
}

void startCapture() {
  enableTimer();
  intrHasCapture = true;
  detachInterrupt(inInterrupt);
}

void dump() {
  while (intrReading) {
    // wait
  }
  intrHasCapture = false;
  for (int c = 0; c < intrOnes; ++c) {
    if (intrAtBit-- == 0) {
      intrAtBit = 7;
      --intrAtByte;
    }
  }
  if (intrAtByte || intrAtBit) {
    for (int atByte = 0, atBit = 0;
         atByte != intrAtByte || atBit != intrAtBit;
         (++atBit == 8) ? (atBit = 0, ++atByte) : 0) {
      if (atByte && atBit == 0) {
        Serial.print(" ");
      }
      Serial.print((intrSamples[atByte] & (1 << atBit)) ? '1' : '0');
    }
    if (intrZeroes == 20) {
      Serial.print("/*..*/");
    }
    Serial.println();
  }
  enableCaptureInterrupt();  
}

void loop() {
  if (intrHasCapture) {
    dump();
  }
}
