Skip to content

Commit 763bc1b

Browse files
authored
Merge pull request #2 from hmueller01/cleanup
removed unused code and comments
2 parents e83c771 + 90c8858 commit 763bc1b

File tree

1 file changed

+5
-36
lines changed

1 file changed

+5
-36
lines changed

src/ESP_WiFiManager_Lite.h

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ uint32_t getChipOUI();
340340

341341
///////////////////////////////////////////
342342

343-
//NEW
344343
#define MAX_ID_LEN 5
345344
#define MAX_DISPLAY_NAME_LEN 16
346345

@@ -480,8 +479,6 @@ const char ESP_WM_LITE_HTML_END[] PROGMEM = "</html>";
480479

481480
//////////////////////////////////////////
482481

483-
//KH Add repeatedly used const
484-
485482
const char WM_HTTP_HEAD_CL[] PROGMEM = "Content-Length";
486483
const char WM_HTTP_HEAD_TEXT_HTML[] PROGMEM = "text/html";
487484
const char WM_HTTP_HEAD_TEXT_PLAIN[] PROGMEM = "text/plain";
@@ -1024,21 +1021,19 @@ class ESP_WiFiManager_Lite
10241021
WiFi.hostname(RFC952_hostname);
10251022
#else
10261023

1027-
10281024
// Check cores/esp32/esp_arduino_version.h and cores/esp32/core_version.h
10291025
#if ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) )
10301026
WiFi.setHostname(RFC952_hostname);
10311027
#else
1032-
10331028
// Still have bug in ESP32_S2 for old core. If using WiFi.setHostname() => WiFi.localIP() always = 255.255.255.255
10341029
if ( String(ARDUINO_BOARD) != "ESP32S2_DEV" )
10351030
{
10361031
// See https://github.com/espressif/arduino-esp32/issues/2537
10371032
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE);
10381033
WiFi.setHostname(RFC952_hostname);
10391034
}
1040-
10411035
#endif
1036+
10421037
#endif
10431038
}
10441039
}
@@ -1915,24 +1910,7 @@ class ESP_WiFiManager_Lite
19151910
ESP_WML_LOGINFO(F("failed"));
19161911
}
19171912
}
1918-
#endif
1919-
1920-
//////////////////////////////////////////////
1921-
1922-
void NULLTerminateConfig()
1923-
{
1924-
//#define HEADER_MAX_LEN 16
1925-
//#define SERVER_MAX_LEN 32
1926-
//#define TOKEN_MAX_LEN 36
1927-
1928-
// NULL Terminating to be sure
1929-
ESP_WM_LITE_config.header[HEADER_MAX_LEN - 1] = 0;
1930-
ESP_WM_LITE_config.WiFi_Creds[0].wifi_ssid[SSID_MAX_LEN - 1] = 0;
1931-
ESP_WM_LITE_config.WiFi_Creds[0].wifi_pw [PASS_MAX_LEN - 1] = 0;
1932-
ESP_WM_LITE_config.WiFi_Creds[1].wifi_ssid[SSID_MAX_LEN - 1] = 0;
1933-
ESP_WM_LITE_config.WiFi_Creds[1].wifi_pw [PASS_MAX_LEN - 1] = 0;
1934-
ESP_WM_LITE_config.board_name[BOARD_NAME_MAX_LEN - 1] = 0;
1935-
}
1913+
#endif // USE_DYNAMIC_PARAMETERS
19361914

19371915
//////////////////////////////////////////////
19381916

@@ -2167,10 +2145,8 @@ class ESP_WiFiManager_Lite
21672145

21682146
#endif
21692147

2170-
// Don't need
2171-
ESP_WM_LITE_config.checkSum = 0;
2172-
21732148
saveAllConfigData();
2149+
displayConfigData(ESP_WM_LITE_config);
21742150

21752151
return false;
21762152
}
@@ -2208,7 +2184,7 @@ class ESP_WiFiManager_Lite
22082184
#endif
22092185

22102186
#ifndef EEPROM_START
2211-
#define EEPROM_START 0 //define 256 in DRD/MRD
2187+
#define EEPROM_START 0 // define 256 in DRD/MRD
22122188
#else
22132189
#if (EEPROM_START + FLAG_DATA_SIZE + CONFIG_DATA_SIZE + FORCED_CONFIG_PORTAL_FLAG_DATA_SIZE > EEPROM_SIZE)
22142190
#error EPROM_START + FLAG_DATA_SIZE + CONFIG_DATA_SIZE + FORCED_CONFIG_PORTAL_FLAG_DATA_SIZE > EEPROM_SIZE. Please adjust.
@@ -2553,10 +2529,8 @@ class ESP_WiFiManager_Lite
25532529

25542530
#endif
25552531

2556-
// Don't need
2557-
ESP_WM_LITE_config.checkSum = 0;
2558-
25592532
saveAllConfigData();
2533+
displayConfigData(ESP_WM_LITE_config);
25602534

25612535
return false;
25622536
}
@@ -2565,10 +2539,6 @@ class ESP_WiFiManager_Lite
25652539
// If SSID, PW ="blank" or NULL, stay in config mode forever until having config Data.
25662540
return false;
25672541
}
2568-
else
2569-
{
2570-
displayConfigData(ESP_WM_LITE_config);
2571-
}
25722542

25732543
return true;
25742544
}
@@ -2660,7 +2630,6 @@ class ESP_WiFiManager_Lite
26602630

26612631
//////////////////////////////////////////////
26622632

2663-
// NEW
26642633
void createHTML(String& root_html_template)
26652634
{
26662635
String pitem;

0 commit comments

Comments
 (0)