@@ -27,8 +27,6 @@ SOFTWARE.
2727
2828#define VERSION " 0.3.0"
2929
30- bool eth_connected = false ;
31-
3230#include " Arduino.h"
3331#include " Wire.h"
3432#include < SPI.h>
@@ -54,12 +52,13 @@ IO2 io2 = IO2(); // set I2C address of MOD-IO2
5452#include < Update.h>
5553#include " magicnumbers.h"
5654#include " config.h"
57- Config config;
55+
5856#include < WiegandNG.h>
5957
58+ Config config;
6059File fsUploadFile;
61-
6260WiegandNG wg;
61+ Desfire desfire;
6362
6463// relay specific variables
6564#if MAX_NUM_RELAYS == 4
@@ -79,8 +78,6 @@ bool activateRelay[MAX_NUM_RELAYS] = {false};
7978bool deactivateRelay[MAX_NUM_RELAYS] = {false };
8079#endif
8180
82- Desfire desfire;
83-
8481// The PICC master key.
8582// This 3K3DES or AES key is the "god key".
8683// It allows to format the card and erase ALL it's content (except the PICC master key itself).
@@ -151,6 +148,7 @@ unsigned long currentMillis = 0;
151148unsigned long deltaTime = 0 ;
152149bool doEnableWifi = false ;
153150bool doEnableEth = false ;
151+ bool eth_connected = false ;
154152bool formatreq = false ;
155153const char *httpUsername = " admin" ;
156154unsigned long keyTimer = 0 ;
@@ -287,10 +285,7 @@ void setup()
287285 bool configured = false ;
288286 configured = loadConfiguration (config);
289287 // ethernet setup
290- bool configuredeth = false ;
291- configuredeth = configured;
292- eth_connected = false ;
293- setupEth (configuredeth);
288+ setupEth ();
294289 config.ipAddressEth = ETH.localIP ();
295290 config.gatewayIpEth = ETH.gatewayIP ();
296291 config.subnetIpEth = ETH.subnetMask ();
@@ -354,7 +349,6 @@ void IRAM_ATTR loop()
354349 }
355350
356351 // relay
357-
358352 for (int currentRelay = 0 ; currentRelay < config.numRelays ; currentRelay++)
359353 {
360354 if (config.lockType [currentRelay] == LOCKTYPE_CONTINUOUS) // Continuous relay mode
0 commit comments