sforkowany z mirror/meshtastic-firmware
Merge branch 'master' into master
commit
004a6f9c25
|
@ -2,8 +2,8 @@
|
||||||
#include "FSCommon.h"
|
#include "FSCommon.h"
|
||||||
|
|
||||||
void listDir(const char * dirname, uint8_t levels)
|
void listDir(const char * dirname, uint8_t levels)
|
||||||
#ifdef FSCom
|
|
||||||
{
|
{
|
||||||
|
#ifdef FSCom
|
||||||
File root = FSCom.open(dirname);
|
File root = FSCom.open(dirname);
|
||||||
if(!root){
|
if(!root){
|
||||||
return;
|
return;
|
||||||
|
@ -29,29 +29,41 @@ void listDir(const char * dirname, uint8_t levels)
|
||||||
}
|
}
|
||||||
|
|
||||||
void rmDir(const char * dirname)
|
void rmDir(const char * dirname)
|
||||||
#ifdef FSCom
|
|
||||||
{
|
{
|
||||||
File root = FSCom.open(dirname);
|
#ifdef FSCom
|
||||||
if(!root){
|
File file = FSCom.open(dirname);
|
||||||
|
if(!file){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!root.isDirectory()){
|
if(!file.isDirectory()){
|
||||||
|
file.close();
|
||||||
|
FSCom.remove(file.name());
|
||||||
|
// DEBUG_MSG("Remove FILE %s\n", file.name());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
File file = root.openNextFile();
|
file.rewindDirectory();
|
||||||
while(file){
|
while (true) {
|
||||||
if(file.isDirectory() && !String(file.name()).endsWith(".")) {
|
File entry = file.openNextFile();
|
||||||
file.close();
|
if (!entry) {
|
||||||
rmDir(file.name());
|
break;
|
||||||
FSCom.rmdir(file.name());
|
}
|
||||||
} else {
|
char dirpath[100]; // array to hold the result.
|
||||||
file.close();
|
strcpy(dirpath, dirname); // copy string one into the result.
|
||||||
FSCom.remove(file.name());
|
strcat(dirpath,"/"); // append string two to the result.
|
||||||
|
strcat(dirpath,entry.name()); // append string two to the result.
|
||||||
|
if(entry.isDirectory() && !String(entry.name()).endsWith(".")) {
|
||||||
|
entry.close();
|
||||||
|
// DEBUG_MSG("Descend DIR %s\n", dirpath);
|
||||||
|
rmDir(dirpath);
|
||||||
|
} else {
|
||||||
|
entry.close();
|
||||||
|
// DEBUG_MSG("Remove FILE %s\n", entry.name());
|
||||||
|
FSCom.remove(entry.name());
|
||||||
}
|
}
|
||||||
file.close();
|
|
||||||
file = root.openNextFile();
|
|
||||||
}
|
}
|
||||||
|
FSCom.rmdir(dirname);
|
||||||
|
// DEBUG_MSG("Remove DIR %s\n", dirname);
|
||||||
file.close();
|
file.close();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,10 +142,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Disable use of the NTP library and related features
|
// Disable use of the NTP library and related features
|
||||||
//#define DISABLE_NTP
|
// #define DISABLE_NTP
|
||||||
|
|
||||||
// Disable the welcome screen and allow
|
// Disable the welcome screen and allow
|
||||||
#define DISABLE_WELCOME_UNSET
|
// #define DISABLE_WELCOME_UNSET
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// OLED & Input
|
// OLED & Input
|
||||||
|
|
|
@ -1531,10 +1531,10 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat
|
||||||
case Config_LoRaConfig_ModemPreset_MedFast:
|
case Config_LoRaConfig_ModemPreset_MedFast:
|
||||||
mode = "MedF";
|
mode = "MedF";
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_LongFast:
|
case Config_LoRaConfig_ModemPreset_LongSlow:
|
||||||
mode = "LongS";
|
mode = "LongS";
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_LongSlow:
|
case Config_LoRaConfig_ModemPreset_LongFast:
|
||||||
mode = "LongF";
|
mode = "LongF";
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_VLongSlow:
|
case Config_LoRaConfig_ModemPreset_VLongSlow:
|
||||||
|
|
|
@ -105,7 +105,7 @@ const char *getDeviceName()
|
||||||
static char name[20];
|
static char name[20];
|
||||||
sprintf(name, "%02x%02x", dmac[4], dmac[5]);
|
sprintf(name, "%02x%02x", dmac[4], dmac[5]);
|
||||||
// if the shortname exists and is NOT the new default of ab3c, use it for BLE name.
|
// if the shortname exists and is NOT the new default of ab3c, use it for BLE name.
|
||||||
if ((owner.short_name != NULL) && (owner.short_name != name)) {
|
if ((owner.short_name != NULL) && (strcmp(owner.short_name, name) != 0)) {
|
||||||
sprintf(name, "%s_%02x%02x", owner.short_name, dmac[4], dmac[5]);
|
sprintf(name, "%s_%02x%02x", owner.short_name, dmac[4], dmac[5]);
|
||||||
} else {
|
} else {
|
||||||
sprintf(name, "Meshtastic_%02x%02x", dmac[4], dmac[5]);
|
sprintf(name, "Meshtastic_%02x%02x", dmac[4], dmac[5]);
|
||||||
|
|
|
@ -211,7 +211,7 @@ const char *Channels::getName(size_t chIndex)
|
||||||
// the app fucked up and forgot to set channelSettings.name
|
// the app fucked up and forgot to set channelSettings.name
|
||||||
|
|
||||||
if (config.lora.bandwidth != 0)
|
if (config.lora.bandwidth != 0)
|
||||||
channelName = "Unset";
|
channelName = "Custom";
|
||||||
else
|
else
|
||||||
switch (config.lora.modem_preset) {
|
switch (config.lora.modem_preset) {
|
||||||
case Config_LoRaConfig_ModemPreset_ShortSlow:
|
case Config_LoRaConfig_ModemPreset_ShortSlow:
|
||||||
|
@ -226,10 +226,10 @@ const char *Channels::getName(size_t chIndex)
|
||||||
case Config_LoRaConfig_ModemPreset_MedFast:
|
case Config_LoRaConfig_ModemPreset_MedFast:
|
||||||
channelName = "MedF";
|
channelName = "MedF";
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_LongFast:
|
case Config_LoRaConfig_ModemPreset_LongSlow:
|
||||||
channelName = "LongS";
|
channelName = "LongS";
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_LongSlow:
|
case Config_LoRaConfig_ModemPreset_LongFast:
|
||||||
channelName = "LongF";
|
channelName = "LongF";
|
||||||
break;
|
break;
|
||||||
case Config_LoRaConfig_ModemPreset_VLongSlow:
|
case Config_LoRaConfig_ModemPreset_VLongSlow:
|
||||||
|
|
|
@ -337,16 +337,16 @@ void NodeDB::loadFromDisk()
|
||||||
DEBUG_MSG("Warn: devicestate %d is old, discarding\n", devicestate.version);
|
DEBUG_MSG("Warn: devicestate %d is old, discarding\n", devicestate.version);
|
||||||
installDefaultDeviceState();
|
installDefaultDeviceState();
|
||||||
#ifndef NO_ESP32
|
#ifndef NO_ESP32
|
||||||
// This will erase what's in NVS including ssl keys, persistant variables and ble pairing
|
// This will erase what's in NVS including ssl keys, persistant variables and ble pairing
|
||||||
nvs_flash_erase();
|
nvs_flash_erase();
|
||||||
#endif
|
#endif
|
||||||
#ifdef NRF52_SERIES
|
#ifdef NRF52_SERIES
|
||||||
Bluefruit.begin();
|
Bluefruit.begin();
|
||||||
DEBUG_MSG("Clearing bluetooth bonds!\n");
|
DEBUG_MSG("Clearing bluetooth bonds!\n");
|
||||||
bond_print_list(BLE_GAP_ROLE_PERIPH);
|
bond_print_list(BLE_GAP_ROLE_PERIPH);
|
||||||
bond_print_list(BLE_GAP_ROLE_CENTRAL);
|
bond_print_list(BLE_GAP_ROLE_CENTRAL);
|
||||||
Bluefruit.Periph.clearBonds();
|
Bluefruit.Periph.clearBonds();
|
||||||
Bluefruit.Central.clearBonds();
|
Bluefruit.Central.clearBonds();
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("Loaded saved devicestate version %d\n", devicestate.version);
|
DEBUG_MSG("Loaded saved devicestate version %d\n", devicestate.version);
|
||||||
|
|
Ładowanie…
Reference in New Issue