Fixed wrong position of EEPROM.h

pull/123/head
Hieromon Ikasamo 6 years ago
parent af2d505dde
commit 7fdad5cad9
  1. 28
      src/AutoConnectCredential.h

@ -21,30 +21,24 @@
#include <Arduino.h> #include <Arduino.h>
#include <memory> #include <memory>
#if defined(ARDUINO_ARCH_ESP8266) #if defined(ARDUINO_ARCH_ESP8266)
#define AC_CREDENTIAL_PREFERENCES 0
extern "C" { extern "C" {
#include <user_interface.h> #include <user_interface.h>
} }
#define AC_CREDENTIAL_PREFERENCES 0
#elif defined(ARDUINO_ARCH_ESP32) #elif defined(ARDUINO_ARCH_ESP32)
#include <esp_wifi.h>
struct station_config {
uint8_t ssid[32];
uint8_t password[64];
uint8_t bssid_set;
uint8_t bssid[6];
wifi_fast_scan_threshold_t threshold;
};
#ifdef AUTOCONNECT_USE_PREFERENCES #ifdef AUTOCONNECT_USE_PREFERENCES
#define AC_CREDENTIAL_PREFERENCES 1 #define AC_CREDENTIAL_PREFERENCES 1
#include <map>
#include <Preferences.h>
#else #else
#define AC_CREDENTIAL_PREFERENCES 0 #define AC_CREDENTIAL_PREFERENCES 0
#endif #endif
#if AC_CREDENTIAL_PREFERENCES == 0 #include <esp_wifi.h>
#define NO_GLOBAL_EEPROM struct station_config {
#include <EEPROM.h> uint8_t ssid[32];
#endif uint8_t password[64];
uint8_t bssid_set;
uint8_t bssid[6];
wifi_fast_scan_threshold_t threshold;
};
#endif #endif
/** /**
@ -83,6 +77,8 @@ class AutoConnectCredentialBase {
#if AC_CREDENTIAL_PREFERENCES == 0 #if AC_CREDENTIAL_PREFERENCES == 0
// #pragma message "AutoConnectCredential applies the EEPROM" // #pragma message "AutoConnectCredential applies the EEPROM"
#define NO_GLOBAL_EEPROM
#include <EEPROM.h>
/** AutoConnectCredential class using EEPROM for ESP8266 */ /** AutoConnectCredential class using EEPROM for ESP8266 */
class AutoConnectCredential : public AutoConnectCredentialBase { class AutoConnectCredential : public AutoConnectCredentialBase {
@ -109,6 +105,8 @@ class AutoConnectCredential : public AutoConnectCredentialBase {
#else #else
// #pragma message "AutoConnectCredential applies the Preferences" // #pragma message "AutoConnectCredential applies the Preferences"
#include <map>
#include <Preferences.h>
#define AC_CREDENTIAL_NVSNAME AC_IDENTIFIER #define AC_CREDENTIAL_NVSNAME AC_IDENTIFIER
#define AC_CREDENTIAL_NVSKEY AC_CREDENTIAL_NVSNAME #define AC_CREDENTIAL_NVSKEY AC_CREDENTIAL_NVSNAME

Loading…
Cancel
Save