 
   // open the USB serial port for reporting
   Serial.begin(BAUD);
-#if DEBUG > 0 
+#if DEBUG > 0
   Serial.println(F("Target Module"));
   Serial.println(F("============="));
-#endif  
+#endif
   // 1ms timer interrupt to check for hits
-  Timer1.initialize(1000); 
-  
+  Timer1.initialize(1000);
+
   pinMode(53, OUTPUT);
   if (!SD.begin(SPI_CS)) {
-#if DEBUG > 0 
+#if DEBUG > 0
     Serial.println("SD card failed, or not present");
 #endif
     // don't do anything more:
     return;
   }
-#if DEBUG > 0 
+#if DEBUG > 0
   Serial.println("SD card initialized.");
 #endif
-  
+
   Wire.begin();
   RTC.begin();
   if (! RTC.isrunning()) {
-#if DEBUG > 0 
+#if DEBUG > 0
     Serial.println("RTC is NOT running!");
 #endif
     // following line sets the RTC to the date & time this sketch was compiled

      report_score = false;
    } else if ((write_marker - calc_marker) % BUFFER_LINES <= 0) {
      // reply once all the score lines have been processed
      Serial.println(current_score);
      report_score = false;
    }
  }
      
}

void piezoCheck() {
  // using the Mega analog pins for 16 inputs
  for (byte i=0; i<PINS; i++) {
    if (analogRead(i+A0) >= SCORE_THRESHOLD && millis() - last_hit[i] >= DEBOUNCE_LIMIT) {
      write_marker++;
      write_marker = write_marker % BUFFER_LINES;
      hit_record[write_marker].setTarget(i);
      last_hit[i] = millis();
      hit_record[write_marker].timestamp = last_hit[i] - start_time;
    }
  }
}

unsigned long start_time = 0UL;
boolean report_score = false;
boolean file_open = false;
long current_score = 0UL;
char player_rfid[RFID_DIGITS] = "12345678"; // first 8 chars for folder name
char filepath[FOLDER_BUFFER];

