diff --git a/platformio.ini b/platformio.ini index f2895ca..c0883d7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -58,7 +58,7 @@ board_build.partitions = huge_app.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} - https://github.com/biologist79/rfid.git + https://github.com/miguelbalboa/rfid.git https://github.com/tueddy/PN5180-Library.git extra_scripts = ${env:common.extra_scripts} upload_port = /dev/cu.SLAB_USBtoUART @@ -76,7 +76,7 @@ board_build.partitions = huge_app.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} - https://github.com/biologist79/rfid.git + https://github.com/miguelbalboa/rfid.git https://github.com/tueddy/PN5180-Library.git extra_scripts = ${env:common.extra_scripts} upload_port = /dev/cu.wchusbserial1410 @@ -94,7 +94,7 @@ board_build.partitions = huge_app.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} - https://github.com/biologist79/rfid.git + https://github.com/miguelbalboa/rfid.git https://github.com/tueddy/PN5180-Library.git extra_scripts = ${env:common.extra_scripts} upload_port = /dev/cu.wchusbserial1410 @@ -114,7 +114,7 @@ board_build.partitions = huge_app.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} - https://github.com/biologist79/rfid.git + https://github.com/miguelbalboa/rfid.git https://github.com/tueddy/PN5180-Library.git extra_scripts = ${env:common.extra_scripts} upload_port = /dev/cu.SLAB_USBtoUART @@ -132,7 +132,7 @@ board_build.partitions = huge_app.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} - https://github.com/biologist79/rfid.git + https://github.com/miguelbalboa/rfid.git https://github.com/tueddy/PN5180-Library.git extra_scripts = ${env:common.extra_scripts} upload_port = /dev/cu.SLAB_USBtoUART diff --git a/src/main.cpp b/src/main.cpp index 7097f9a..b9aae47 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4227,6 +4227,7 @@ void setup() { #ifdef RFID_READER_TYPE_MFRC522_SPI mfrc522.PCD_Init(); + mfrc522.PCD_SetAntennaGain(rfidGain); delay(50); loggerNl(serialDebug, (char *) FPSTR(rfidScannerReady), LOGLEVEL_DEBUG); #endif diff --git a/src/settings.h b/src/settings.h index 767891d..2cf7cc8 100644 --- a/src/settings.h +++ b/src/settings.h @@ -33,15 +33,22 @@ //################## select SD card mode ############################# -//#define SD_MMC_1BIT_MODE // run SD card in SD-MMC 1Bit mode -//#define SINGLE_SPI_ENABLE // If only one SPI-instance should be used instead of two (not yet working!) (Works on ESP32-A1S with RFID via I2C) +//#define SD_MMC_1BIT_MODE // run SD card in SD-MMC 1Bit mode +//#define SINGLE_SPI_ENABLE // If only one SPI-instance should be used instead of two (not yet working!) (Works on ESP32-A1S with RFID via I2C) //################## select RFID reader ############################## -#define RFID_READER_TYPE_MFRC522_SPI // use MFRC522 via SPI -//#define RFID_READER_TYPE_MFRC522_I2C // use MFRC522 via I2C -//#define RFID_READER_TYPE_PN5180 // use PN5180 -//#define PN5180_ENABLE_LPCD // enable PN5180 low power card detection: wake up on card detection +#define RFID_READER_TYPE_MFRC522_SPI // use MFRC522 via SPI +//#define RFID_READER_TYPE_MFRC522_I2C // use MFRC522 via I2C +//#define RFID_READER_TYPE_PN5180 // use PN5180 + +#ifdef RFID_READER_TYPE_PN5180 + //#define PN5180_ENABLE_LPCD // enable PN5180 low power card detection. Wakes up ESPuino if RFID-tag was applied while deepsleep is active. +#endif + +#ifdef RFID_READER_TYPE_MFRC522_SPI + uint8_t rfidGain = 0x07 << 4; // Sensitivity of RC522. For possible values see reference: https://forum.espuino.de/uploads/default/original/1X/9de5f8d35cbc123c1378cad1beceb3f51035cec0.png +#endif //#################### Various settings ##############################