Moznost pouzit editor souboroveho systemu pomoci USE_WIFICONFIG_FSEDITOR, bugfix v ID cipu pro ESP32
This commit is contained in:
		@@ -20,6 +20,10 @@
 | 
			
		||||
#  define USEDFS LittleFS
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef USE_WIFICONFIG_FSEDITOR
 | 
			
		||||
# include <SPIFFSEditor.h>
 | 
			
		||||
# include <FSWebEditor.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(ESP8266)
 | 
			
		||||
// ESP8266
 | 
			
		||||
@@ -39,10 +43,8 @@
 | 
			
		||||
extern "C" {
 | 
			
		||||
# include "user_interface.h"
 | 
			
		||||
}
 | 
			
		||||
# define ESP_getChipId() (ESP.getChipId())
 | 
			
		||||
#else
 | 
			
		||||
# include <esp_wifi.h>
 | 
			
		||||
# define ESP_getChipId() ((uint32_t)ESP.getEfuseMac())
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define DNS_PORT 53
 | 
			
		||||
@@ -53,6 +55,20 @@ static const char CHECKED[] PROGMEM = "checked='checked'";
 | 
			
		||||
 | 
			
		||||
static bool _doReconfig = false; // TODO: mozna nejak elegantneji? Ale zase setrime RAM...
 | 
			
		||||
 | 
			
		||||
static uint32_t ESP_getChipId(void)
 | 
			
		||||
{
 | 
			
		||||
#if defined(ESP8266)
 | 
			
		||||
    return ESP.getChipId();
 | 
			
		||||
#else
 | 
			
		||||
    uint32_t id = 0;
 | 
			
		||||
 | 
			
		||||
    for (int i = 0; i < 17; i = i + 8) {
 | 
			
		||||
        id |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
 | 
			
		||||
    }
 | 
			
		||||
    return id;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
IPAddress getOurIP(void)
 | 
			
		||||
{
 | 
			
		||||
    IPAddress ipa;
 | 
			
		||||
@@ -592,6 +608,21 @@ wificonfigresult_t WiFiConfig::_setupAP(wificonfig_cb cb)
 | 
			
		||||
        }
 | 
			
		||||
        yield();
 | 
			
		||||
    });
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef USE_WIFICONFIG_FSEDITOR
 | 
			
		||||
#if 0
 | 
			
		||||
#if defined(ESP8266)
 | 
			
		||||
        server->addHandler(new SPIFFSEditor("admin", "nimda", USEDFS));
 | 
			
		||||
#else
 | 
			
		||||
        server->addHandler(new SPIFFSEditor(USEDFS, "admin", "nimda"));
 | 
			
		||||
#endif
 | 
			
		||||
#else
 | 
			
		||||
#if defined(ESP8266)
 | 
			
		||||
        server->addHandler(new FSWebEditor("admin", "nimda"));
 | 
			
		||||
#else
 | 
			
		||||
        server->addHandler(new FSWebEditor(USEDFS, "admin", "nimda"));
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
    server->begin(); // startujeme webovy server
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -135,7 +135,7 @@ private:
 | 
			
		||||
class WiFiConfig
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    WiFiConfig(): _params(NULL), _timeout(0) {}
 | 
			
		||||
    WiFiConfig(): _params(nullptr), _timeout(0) {}
 | 
			
		||||
    wificonfigresult_t begin(int forceConfigure, wificonfig_cb cb);
 | 
			
		||||
    wificonfigresult_t begin(int forceConfigure, int timeout, wificonfig_cb cb);
 | 
			
		||||
    void addParameter(WiFiConfigUsrParameter *p);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user