Browse Source

Fixing issue if PN5180 is active but without LPCD

master
Torsten Stauder 5 years ago
parent
commit
eacca13ad3
  1. 30
      src/main.cpp

30
src/main.cpp

@ -1953,7 +1953,7 @@ void rfidScanner(void *parameter) {
}
}
}
Serial.println("delete RFID scanner task");
//Serial.println("deleted RFID scanner-task");
vTaskDelete(NULL);
}
#endif
@ -3766,22 +3766,22 @@ void handleUpload(AsyncWebServerRequest *request, String filename, size_t index,
#endif
}
#ifdef PN5180_ENABLE_LPCD
// Print the wake-up reason why ESP32 is awake now
void printWakeUpReason() {
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_sleep_get_wakeup_cause();
switch(wakeup_reason) {
case ESP_SLEEP_WAKEUP_EXT0 : Serial.println(F("Wakeup caused by push button")); break;
case ESP_SLEEP_WAKEUP_EXT1 : Serial.println(F("Wakeup caused by low power card detection")); break;
case ESP_SLEEP_WAKEUP_TIMER : Serial.println(F("Wakeup caused by timer")); break;
case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println(F("Wakeup caused by touchpad")); break;
case ESP_SLEEP_WAKEUP_ULP : Serial.println(F("Wakeup caused by ULP program")); break;
default : Serial.printf("Wakeup was not caused by deep sleep: %d\n", wakeup_reason); break;
}
// Print the wake-up reason why ESP32 is awake now
void printWakeUpReason() {
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_sleep_get_wakeup_cause();
switch(wakeup_reason) {
case ESP_SLEEP_WAKEUP_EXT0 : Serial.println(F("Wakeup caused by push button")); break;
case ESP_SLEEP_WAKEUP_EXT1 : Serial.println(F("Wakeup caused by low power card detection")); break;
case ESP_SLEEP_WAKEUP_TIMER : Serial.println(F("Wakeup caused by timer")); break;
case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println(F("Wakeup caused by touchpad")); break;
case ESP_SLEEP_WAKEUP_ULP : Serial.println(F("Wakeup caused by ULP program")); break;
default : Serial.printf("Wakeup was not caused by deep sleep: %d\n", wakeup_reason); break;
}
}
#ifdef PN5180_ENABLE_LPCD
// wake up from LPCD, check card is present. This works only for ISO-14443 compatible cards
void checkCardIsPresentLPCD() {
static PN5180ISO14443 nfc14443(RFID_CS, RFID_BUSY, RFID_RST);

Loading…
Cancel
Save