mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-14 15:11:32 +10:00
fix up parameters
This commit is contained in:
+6
-4
@@ -77,12 +77,14 @@ const char* WiFiManagerParameter::getCustomHTML() {
|
||||
}
|
||||
|
||||
bool WiFiManager::addParameter(WiFiManagerParameter *p) {
|
||||
if(_paramsCount + 1 > _max_params){
|
||||
// rezise the params array
|
||||
if(_paramsCount + 1 == _max_params){
|
||||
// resize the params array by increment of WIFI_MANAGER_MAX_PARAMS
|
||||
_max_params += WIFI_MANAGER_MAX_PARAMS;
|
||||
DEBUG_WM(F("Increasing _max_params to:"));
|
||||
DEBUG_WM(_max_params);
|
||||
DEBUG_WM(F("Updated _max_params:"),_max_params);
|
||||
WiFiManagerParameter** new_params = (WiFiManagerParameter**)realloc(_params, _max_params * sizeof(WiFiManagerParameter*));
|
||||
// DEBUG_WM(WIFI_MANAGER_MAX_PARAMS);
|
||||
// DEBUG_WM(_paramsCount);
|
||||
// DEBUG_WM(_max_params);
|
||||
if (new_params != NULL) {
|
||||
_params = new_params;
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ const char HTTP_SCAN_LINK[] PROGMEM = "<br/><form action='/wifi' method='g
|
||||
const char HTTP_SAVED[] PROGMEM = "<div class='msg'>Saving Credentials<br/>Trying to connect ESP to network.<br />If it fails reconnect to AP to try again</div>";
|
||||
const char HTTP_END[] PROGMEM = "</div></body></html>";
|
||||
|
||||
#define WIFI_MANAGER_MAX_PARAMS 10
|
||||
#define WIFI_MANAGER_MAX_PARAMS 5
|
||||
|
||||
#define WFM_LABEL_BEFORE 1
|
||||
#define WFM_LABEL_AFTER 2
|
||||
|
||||
Reference in New Issue
Block a user