fix up parameters

This commit is contained in:
Shawn A
2018-01-31 09:30:37 -06:00
parent fa04972cb1
commit 5f78d38f46
2 changed files with 7 additions and 5 deletions
+6 -4
View File
@@ -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
View File
@@ -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