diff --git a/proto b/proto index cb7bf9ac2..79d24080f 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit cb7bf9ac239b87c6a988feb0bb49c8a3e85dea0e +Subproject commit 79d24080ff83b0a54bc1619f07f41f17ffedfb99 diff --git a/src/mesh/generated/admin.pb.h b/src/mesh/generated/admin.pb.h index da91fcd99..f6e8ac5e5 100644 --- a/src/mesh/generated/admin.pb.h +++ b/src/mesh/generated/admin.pb.h @@ -5,9 +5,9 @@ #define PB_ADMIN_PB_H_INCLUDED #include #include "channel.pb.h" +#include "config.pb.h" #include "mesh.pb.h" #include "radioconfig.pb.h" -#include "config.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 2f3f116d5..8b78a2bb1 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -307,7 +307,7 @@ void AdminModule::handleSetRadio(RadioConfig &r) service.reloadConfig(); } -void AdminModule::handleSetConfig(Config &c) +void AdminModule::handleSetConfig(const Config &c) { switch (c.which_payloadVariant) { case AdminMessage_ConfigType_ALL: diff --git a/src/modules/AdminModule.h b/src/modules/AdminModule.h index ef71b54eb..d31d4269b 100644 --- a/src/modules/AdminModule.h +++ b/src/modules/AdminModule.h @@ -23,7 +23,7 @@ class AdminModule : public ProtobufModule void handleSetOwner(const User &o); void handleSetChannel(const Channel &cc); void handleSetRadio(RadioConfig &r); - void handleSetConfig(Config &c); + void handleSetConfig(const Config &c); void handleGetChannel(const MeshPacket &req, uint32_t channelIndex); void handleGetRadio(const MeshPacket &req); diff --git a/src/sleep.cpp b/src/sleep.cpp index fce4f02a3..849ec33a1 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -1,9 +1,9 @@ -#include "configuration.h" #include "sleep.h" #include "GPS.h" #include "MeshRadio.h" #include "MeshService.h" #include "NodeDB.h" +#include "configuration.h" #include "error.h" #include "main.h" #include "target_specific.h" @@ -11,10 +11,10 @@ #ifndef NO_ESP32 #include "esp32/pm.h" #include "esp_pm.h" +#include "mesh/http/WiFiAPClient.h" #include "rom/rtc.h" #include #include -#include "mesh/http/WiFiAPClient.h" #include "nimble/BluetoothUtil.h" @@ -51,25 +51,25 @@ void setCPUFast(bool on) #ifndef NO_ESP32 if (isWifiAvailable()) { - /* - * - * There's a newly introduced bug in the espressif framework where WiFi is - * unstable when the frequency is less than 240mhz. - * - * This mostly impacts WiFi AP mode but we'll bump the frequency for - * all WiFi use cases. - * (Added: Dec 23, 2021 by Jm Casler) - */ + /* + * + * There's a newly introduced bug in the espressif framework where WiFi is + * unstable when the frequency is less than 240mhz. + * + * This mostly impacts WiFi AP mode but we'll bump the frequency for + * all WiFi use cases. + * (Added: Dec 23, 2021 by Jm Casler) + */ DEBUG_MSG("Setting CPU to 240mhz because WiFi is in use.\n"); setCpuFrequencyMhz(240); return; } - // The Heltec LORA32 V1 runs at 26 MHz base frequency and doesn't react well to switching to 80 MHz... - #ifndef ARDUINO_HELTEC_WIFI_LORA_32 - setCpuFrequencyMhz(on ? 240 : 80); - #endif - +// The Heltec LORA32 V1 runs at 26 MHz base frequency and doesn't react well to switching to 80 MHz... +#ifndef ARDUINO_HELTEC_WIFI_LORA_32 + setCpuFrequencyMhz(on ? 240 : 80); +#endif + #endif } @@ -284,12 +284,12 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r */ void enableModemSleep() { - static esp_pm_config_esp32_t config; // filled with zeros because bss + static esp_pm_config_esp32_t esp32_config; // filled with zeros because bss - config.max_freq_mhz = CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ; - config.min_freq_mhz = 20; // 10Mhz is minimum recommended - config.light_sleep_enable = false; - int rv = esp_pm_configure(&config); + esp32_config.max_freq_mhz = CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ; + esp32_config.min_freq_mhz = 20; // 10Mhz is minimum recommended + esp32_config.light_sleep_enable = false; + int rv = esp_pm_configure(&esp32_config); DEBUG_MSG("Sleep request result %x\n", rv); } #endif