mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
moved non blocking to advanced, accidently put in basic
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
|
||||
#define TRIGGER_PIN 0
|
||||
|
||||
// wifimanager can run in a blocking mode or a non blocking mode
|
||||
// Be sure to know how to process loops with no delay() if using non blocking
|
||||
bool wm_nonblocking = false;
|
||||
|
||||
WiFiManager wm; // global wm instance
|
||||
WiFiManagerParameter custom_field; // global param ( for non blocking w params )
|
||||
|
||||
@@ -20,6 +24,8 @@ void setup() {
|
||||
|
||||
// wm.resetSettings(); // wipe settings
|
||||
|
||||
if(wm_nonblocking) wm.setConfigPortalBlocking(false);
|
||||
|
||||
// add a custom input field
|
||||
int customFieldLength = 40;
|
||||
|
||||
@@ -129,6 +135,7 @@ void saveParamCallback(){
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if(wm_nonblocking) wm.process(); // avoid delays() in loop when non-blocking and other long running code
|
||||
checkButton();
|
||||
// put your main code here, to run repeatedly:
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
|
||||
|
||||
// wifimanager can run in a blocking mode or a non blocking mode
|
||||
// Be sure to know how to process loops with no delay() if using non blocking
|
||||
bool wm_nonblocking = false;
|
||||
|
||||
void setup() {
|
||||
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
|
||||
@@ -13,7 +10,6 @@ void setup() {
|
||||
|
||||
//WiFiManager, Local intialization. Once its business is done, there is no need to keep it around
|
||||
WiFiManager wm;
|
||||
if(wm_nonblocking) wm.setConfigPortalBlocking(false);
|
||||
|
||||
// reset settings - wipe stored credentials for testing
|
||||
// these are stored by the esp library
|
||||
@@ -41,6 +37,5 @@ void setup() {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if(wm_nonblocking) wm.process(); // avoid delays() in loop when non-blocking and other long running code
|
||||
// put your main code here, to run repeatedly:
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user