Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
v1.8.2 to optimize code, etc.
Browse files Browse the repository at this point in the history
### Release v1.8.2

1. Optimize code by using passing by `reference` instead of by `value`
2. Optional `Board_Name` in Menu. Check [option to remove board name from web page #25](khoih-prog/WiFiManager_NINA_Lite#25)
3. Add function `isConfigMode()` to signal system is in Config Portal mode.
  • Loading branch information
khoih-prog committed Feb 22, 2022
1 parent cd01a3e commit 2902e0b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
13 changes: 9 additions & 4 deletions examples/ESPAsync_WiFi/ESPAsync_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@
#include "Credentials.h"
#include "dynamicParams.h"

ESPAsync_WiFiManager_Lite* ESPAsync_WiFiManager;

void heartBeatPrint()
{
static int num = 1;

if (WiFi.status() == WL_CONNECTED)
Serial.print(F("H")); // H means connected to WiFi
Serial.print("H"); // H means connected to WiFi
else
Serial.print(F("F")); // F means not connected to WiFi
{
if (ESPAsync_WiFiManager->isConfigMode())
Serial.print("C"); // C means in Config Mode
else
Serial.print("F"); // F means not connected to WiFi
}

if (num == 80)
{
Expand All @@ -48,8 +55,6 @@ void check_status()
}
}

ESPAsync_WiFiManager_Lite* ESPAsync_WiFiManager;

#if USING_CUSTOMS_STYLE
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>";
Expand Down
5 changes: 5 additions & 0 deletions examples/ESPAsync_WiFi/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@

/////////////////////////////////////////////

// Optional, to use Board Name in Menu
#define USING_BOARD_NAME true

/////////////////////////////////////////////

#include <ESPAsync_WiFiManager_Lite.h>

#if ESP8266
Expand Down
9 changes: 7 additions & 2 deletions examples/ESPAsync_WiFi_MQTT/ESPAsync_WiFi_MQTT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ void heartBeatPrint()
static int num = 1;

if (WiFi.status() == WL_CONNECTED)
Serial.print("W"); // W means connected to WiFi
Serial.print("H"); // H means connected to WiFi
else
Serial.print("N"); // N means not connected to WiFi
{
if (ESPAsync_WiFiManager->isConfigMode())
Serial.print("C"); // C means in Config Mode
else
Serial.print("F"); // F means not connected to WiFi
}

if (num == 40)
{
Expand Down
5 changes: 5 additions & 0 deletions examples/ESPAsync_WiFi_MQTT/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@

/////////////////////////////////////////////

// Optional, to use Board Name in Menu
#define USING_BOARD_NAME true

/////////////////////////////////////////////

#include <ESPAsync_WiFiManager_Lite.h>

#if ESP8266
Expand Down

0 comments on commit 2902e0b

Please sign in to comment.