1.5.1 - fixes some bugs in 1.5.0

This commit is contained in:
proddy
2019-02-04 00:32:50 +01:00
parent 4c41f61c24
commit 2b66688710
7 changed files with 61 additions and 27 deletions

View File

@@ -102,6 +102,11 @@ void MyESP::myDebug_P(PGM_P format_P, ...) {
delete[] buffer;
}
// use Serial?
bool MyESP::getUseSerial() {
return (_use_serial);
}
// called when WiFi is connected, and used to start MDNS
void MyESP::_wifiCallback(justwifi_messages_t code, char * parameter) {
if ((code == MESSAGE_CONNECTED)) {
@@ -629,6 +634,9 @@ void MyESP::_telnetHandle() {
if (charsRead > 0) {
charsRead = 0; // is static, so have to reset
_suspendOutput = false;
if (_use_serial) {
SerialAndTelnet.println(); // force newline if in Telnet
}
_telnetCommand(_command);
}
break;
@@ -814,9 +822,10 @@ void MyESP::_fs_printConfig() {
// format File System
void MyESP::_fs_eraseConfig() {
myDebug_P(PSTR("[FS] Erasing settings, please wait. ESP will automatically restart when finished."));
myDebug_P(PSTR("[FS] Erasing settings, please wait a few seconds. ESP will automatically restart when finished."));
if (SPIFFS.format()) {
delay(2000); // wait 2 seconds
resetESP();
}
}
@@ -833,7 +842,7 @@ bool MyESP::_fs_loadConfig() {
myDebug_P(PSTR("[FS] Failed to open config file"));
// file does not exist, so assume its the first install. Set serial to on
_use_serial = true;
return false;
return false; // this will trigger a new file being created
}
size_t size = configFile.size();

View File

@@ -113,6 +113,7 @@ class MyESP {
void myDebug(const char * format, ...);
void myDebug_P(PGM_P format_P, ...);
void setTelnet(command_t * cmds, uint8_t count, telnetcommand_callback_f callback_cmd, telnet_callback_f callback);
bool getUseSerial();
// FS
void setSettings(fs_callback_f callback, fs_settings_callback_f fs_settings_callback);