Browse Source

Gain-level for RC522 is now changeable via settings.h

master
Torsten Stauder 4 years ago
parent
commit
2bf2757d2f
  1. 10
      platformio.ini
  2. 1
      src/main.cpp
  3. 19
      src/settings.h

10
platformio.ini

@ -58,7 +58,7 @@ board_build.partitions = huge_app.csv
lib_deps = lib_deps =
${common.lib_deps_builtin} ${common.lib_deps_builtin}
${common.lib_deps_external} ${common.lib_deps_external}
https://github.com/biologist79/rfid.git
https://github.com/miguelbalboa/rfid.git
https://github.com/tueddy/PN5180-Library.git https://github.com/tueddy/PN5180-Library.git
extra_scripts = ${env:common.extra_scripts} extra_scripts = ${env:common.extra_scripts}
upload_port = /dev/cu.SLAB_USBtoUART upload_port = /dev/cu.SLAB_USBtoUART
@ -76,7 +76,7 @@ board_build.partitions = huge_app.csv
lib_deps = lib_deps =
${common.lib_deps_builtin} ${common.lib_deps_builtin}
${common.lib_deps_external} ${common.lib_deps_external}
https://github.com/biologist79/rfid.git
https://github.com/miguelbalboa/rfid.git
https://github.com/tueddy/PN5180-Library.git https://github.com/tueddy/PN5180-Library.git
extra_scripts = ${env:common.extra_scripts} extra_scripts = ${env:common.extra_scripts}
upload_port = /dev/cu.wchusbserial1410 upload_port = /dev/cu.wchusbserial1410
@ -94,7 +94,7 @@ board_build.partitions = huge_app.csv
lib_deps = lib_deps =
${common.lib_deps_builtin} ${common.lib_deps_builtin}
${common.lib_deps_external} ${common.lib_deps_external}
https://github.com/biologist79/rfid.git
https://github.com/miguelbalboa/rfid.git
https://github.com/tueddy/PN5180-Library.git https://github.com/tueddy/PN5180-Library.git
extra_scripts = ${env:common.extra_scripts} extra_scripts = ${env:common.extra_scripts}
upload_port = /dev/cu.wchusbserial1410 upload_port = /dev/cu.wchusbserial1410
@ -114,7 +114,7 @@ board_build.partitions = huge_app.csv
lib_deps = lib_deps =
${common.lib_deps_builtin} ${common.lib_deps_builtin}
${common.lib_deps_external} ${common.lib_deps_external}
https://github.com/biologist79/rfid.git
https://github.com/miguelbalboa/rfid.git
https://github.com/tueddy/PN5180-Library.git https://github.com/tueddy/PN5180-Library.git
extra_scripts = ${env:common.extra_scripts} extra_scripts = ${env:common.extra_scripts}
upload_port = /dev/cu.SLAB_USBtoUART upload_port = /dev/cu.SLAB_USBtoUART
@ -132,7 +132,7 @@ board_build.partitions = huge_app.csv
lib_deps = lib_deps =
${common.lib_deps_builtin} ${common.lib_deps_builtin}
${common.lib_deps_external} ${common.lib_deps_external}
https://github.com/biologist79/rfid.git
https://github.com/miguelbalboa/rfid.git
https://github.com/tueddy/PN5180-Library.git https://github.com/tueddy/PN5180-Library.git
extra_scripts = ${env:common.extra_scripts} extra_scripts = ${env:common.extra_scripts}
upload_port = /dev/cu.SLAB_USBtoUART upload_port = /dev/cu.SLAB_USBtoUART

1
src/main.cpp

@ -4227,6 +4227,7 @@ void setup() {
#ifdef RFID_READER_TYPE_MFRC522_SPI #ifdef RFID_READER_TYPE_MFRC522_SPI
mfrc522.PCD_Init(); mfrc522.PCD_Init();
mfrc522.PCD_SetAntennaGain(rfidGain);
delay(50); delay(50);
loggerNl(serialDebug, (char *) FPSTR(rfidScannerReady), LOGLEVEL_DEBUG); loggerNl(serialDebug, (char *) FPSTR(rfidScannerReady), LOGLEVEL_DEBUG);
#endif #endif

19
src/settings.h

@ -33,15 +33,22 @@
//################## select SD card mode ############################# //################## 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 ############################## //################## 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 ############################## //#################### Various settings ##############################

Loading…
Cancel
Save