 }
 
 void initializeNfc() {
-  pinMode(MUSIC_RESET_PIN, OUTPUT);
-  digitalWrite(MUSIC_RESET_PIN, HIGH);
+  pinMode(NFC_RESET_PIN, OUTPUT);
+  digitalWrite(NFC_RESET_PIN, HIGH);
   nfc.begin();
   uint32_t versiondata = nfc.getFirmwareVersion();
   if (!versiondata) {
     Serial.println(F("PN532 failed"));
     return;
   }
-  
-  // Set the max number of retry attempts to read from a card.
-  // This prevents us from waiting forever for a card, which is the default behaviour of the PN532.
+
+  configNfc();
+  Serial.println(F("PN532 initialized"));
+}
+
+// Set the max number of retry attempts to read from a card.
+// This prevents us from waiting forever for a card, which is the default behaviour of the PN532.
+void configNfc() {
   nfc.setPassiveActivationRetries(1);
-  
-  Serial.println(F("PN532 initialized"));
+  nfc.SAMConfig();  
 }
 
 void initializeTimer() {

    playingAlbum = 0;
    blinkSelected(playingAlbum);
    nextTimeoutTick = 0; // no timeout during playing
    enablePlayer(true);
    player.startPlayingFile(trackName.c_str());
    enableAmplifier(!headphone);

}

void enableAmplifier(boolean enable) {
  pinMode(AMPLIFIER_ENABLE_PIN, OUTPUT);
  digitalWrite(AMPLIFIER_ENABLE_PIN, enable);
}

void enableNfc(boolean enable) {
  pinMode(NFC_RESET_PIN, OUTPUT);
  if (enable) {
    Serial.println("Enable NFC");
    digitalWrite(NFC_RESET_PIN, HIGH);
    configNfc();
  } else {
    Serial.println("Disable NFC");
    digitalWrite(NFC_RESET_PIN, LOW);    
  }
}


