mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-14 18:05:58 +08:00
Use FPSTR instead of progmem2char
This commit is contained in:
parent
9e950752e9
commit
e281d1073f
@ -110,8 +110,8 @@ bool CONFIG::write_byte(word pos, const byte value)
|
||||
bool CONFIG::reset_config()
|
||||
{
|
||||
if(!CONFIG::write_byte(EP_WIFI_MODE,DEFAULT_WIFI_MODE))return false;
|
||||
if(!CONFIG::write_string(EP_SSID,PROGMEM2CHAR(DEFAULT_SSID),strlen(PROGMEM2CHAR(DEFAULT_SSID))))return false;
|
||||
if(!CONFIG::write_string(EP_PASSWORD,PROGMEM2CHAR(DEFAULT_PASSWORD),strlen(PROGMEM2CHAR(DEFAULT_PASSWORD))))return false;
|
||||
if(!CONFIG::write_string(EP_SSID,String(FPSTR(DEFAULT_SSID)).c_str(),strlen_P(DEFAULT_SSID)))return false;
|
||||
if(!CONFIG::write_string(EP_PASSWORD,String(FPSTR(DEFAULT_PASSWORD)).c_str(),strlen_P(DEFAULT_PASSWORD)))return false;
|
||||
if(!CONFIG::write_byte(EP_IP_MODE,DEFAULT_IP_MODE))return false;
|
||||
if(!CONFIG::write_buffer(EP_IP_VALUE,DEFAULT_IP_VALUE,IP_LENGH))return false;
|
||||
if(!CONFIG::write_buffer(EP_MASK_VALUE,DEFAULT_MASK_VALUE,IP_LENGH))return false;
|
||||
|
@ -30,9 +30,6 @@
|
||||
//USE_CSS_FEATURE: this feature allow to have fancy UI by adding css in page
|
||||
#define USE_CSS_FEATURE
|
||||
|
||||
#define PROGMEM2CHAR progmem2char
|
||||
|
||||
extern char * progmem2char(const char* src);
|
||||
#ifndef CONFIG_h
|
||||
#define CONFIG_h
|
||||
|
||||
|
@ -52,6 +52,7 @@ WiFiClient serverClients[MAX_SRV_CLIENTS];
|
||||
void setup() {
|
||||
// init :
|
||||
// ESP.wdtDisable();
|
||||
system_update_cpu_freq(SYS_CPU_160MHZ);
|
||||
delay(8000);
|
||||
EEPROM.begin(EEPROM_SIZE);
|
||||
bool breset_config=false;
|
||||
@ -84,6 +85,7 @@ void setup() {
|
||||
}
|
||||
//setup serial
|
||||
Serial.begin(baud_rate);
|
||||
//Serial1.setDebugOutput(true);
|
||||
//setup wifi according settings
|
||||
wifi_config.Setup();
|
||||
delay(1000);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -160,7 +160,7 @@ bool WIFI_CONFIG::Setup()
|
||||
#ifdef MDNS_FEATURE
|
||||
// Set up mDNS responder:
|
||||
if (wifi_get_opmode()==WIFI_STA )
|
||||
if (!mdns.begin(PROGMEM2CHAR(LOCAL_NAME))) {
|
||||
if (!mdns.begin(String(FPSTR(LOCAL_NAME)).c_str())) {
|
||||
Serial.println(F("M117 Error with mDNS!"));
|
||||
delay(1000);
|
||||
}
|
||||
@ -168,7 +168,7 @@ bool WIFI_CONFIG::Setup()
|
||||
//Get IP
|
||||
if (wifi_get_opmode()==WIFI_STA)currentIP=WiFi.localIP();
|
||||
else currentIP=WiFi.softAPIP();
|
||||
Serial.print(PROGMEM2CHAR(M117_));
|
||||
Serial.print(FPSTR(M117_));
|
||||
Serial.println(currentIP);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user