diff --git a/protobufs b/protobufs index 94a4dbb84..274aa01a3 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 94a4dbb842961e75f89de13dc6d0437a256098aa +Subproject commit 274aa01a3862ee83b1ae791c36205e661c4af7ca diff --git a/src/PowerFSM.cpp b/src/PowerFSM.cpp index bdfbda87c..306dd1390 100644 --- a/src/PowerFSM.cpp +++ b/src/PowerFSM.cpp @@ -11,10 +11,10 @@ /// Should we behave as if we have AC power now? static bool isPowered() { - // Completely circumvents the battery / power sensing logic and assumes constant power source - if (config.power.is_always_powered) { + // Circumvent the battery sensing logic and assumes constant power if no battery pin or power mgmt IC + #if !defined(BATTERY_PIN) && !defined(AXP192_SLAVE_ADDRESS) return true; - } + #endif bool isRouter = (config.device.role == Config_DeviceConfig_Role_Router ? 1 : 0); diff --git a/src/mesh/generated/config.pb.h b/src/mesh/generated/config.pb.h index a0da56dc7..13c89544e 100644 --- a/src/mesh/generated/config.pb.h +++ b/src/mesh/generated/config.pb.h @@ -126,7 +126,6 @@ typedef struct _Config_PositionConfig { typedef struct _Config_PowerConfig { Config_PowerConfig_ChargeCurrent charge_current; bool is_power_saving; - bool is_always_powered; uint32_t on_battery_shutdown_after_secs; float adc_multiplier_override; uint32_t wait_bluetooth_secs; @@ -196,14 +195,14 @@ extern "C" { #define Config_init_default {0, {Config_DeviceConfig_init_default}} #define Config_DeviceConfig_init_default {_Config_DeviceConfig_Role_MIN, 0, 0, 0, ""} #define Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0} -#define Config_PowerConfig_init_default {_Config_PowerConfig_ChargeCurrent_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define Config_PowerConfig_init_default {_Config_PowerConfig_ChargeCurrent_MIN, 0, 0, 0, 0, 0, 0, 0, 0} #define Config_WiFiConfig_init_default {"", "", 0, 0} #define Config_DisplayConfig_init_default {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 0} #define Config_LoRaConfig_init_default {0, _Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, {0, 0, 0}} #define Config_init_zero {0, {Config_DeviceConfig_init_zero}} #define Config_DeviceConfig_init_zero {_Config_DeviceConfig_Role_MIN, 0, 0, 0, ""} #define Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0} -#define Config_PowerConfig_init_zero {_Config_PowerConfig_ChargeCurrent_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define Config_PowerConfig_init_zero {_Config_PowerConfig_ChargeCurrent_MIN, 0, 0, 0, 0, 0, 0, 0, 0} #define Config_WiFiConfig_init_zero {"", "", 0, 0} #define Config_DisplayConfig_init_zero {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 0} #define Config_LoRaConfig_init_zero {0, _Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, {0, 0, 0}} @@ -236,7 +235,6 @@ extern "C" { #define Config_PositionConfig_position_flags_tag 10 #define Config_PowerConfig_charge_current_tag 1 #define Config_PowerConfig_is_power_saving_tag 2 -#define Config_PowerConfig_is_always_powered_tag 3 #define Config_PowerConfig_on_battery_shutdown_after_secs_tag 4 #define Config_PowerConfig_adc_multiplier_override_tag 6 #define Config_PowerConfig_wait_bluetooth_secs_tag 7 @@ -295,7 +293,6 @@ X(a, STATIC, SINGULAR, UINT32, position_flags, 10) #define Config_PowerConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, charge_current, 1) \ X(a, STATIC, SINGULAR, BOOL, is_power_saving, 2) \ -X(a, STATIC, SINGULAR, BOOL, is_always_powered, 3) \ X(a, STATIC, SINGULAR, UINT32, on_battery_shutdown_after_secs, 4) \ X(a, STATIC, SINGULAR, FLOAT, adc_multiplier_override, 6) \ X(a, STATIC, SINGULAR, UINT32, wait_bluetooth_secs, 7) \ @@ -357,7 +354,7 @@ extern const pb_msgdesc_t Config_LoRaConfig_msg; #define Config_DisplayConfig_size 14 #define Config_LoRaConfig_size 67 #define Config_PositionConfig_size 30 -#define Config_PowerConfig_size 47 +#define Config_PowerConfig_size 45 #define Config_WiFiConfig_size 103 #define Config_size 105 diff --git a/src/mesh/generated/localonly.pb.h b/src/mesh/generated/localonly.pb.h index 460051245..031983fc0 100644 --- a/src/mesh/generated/localonly.pb.h +++ b/src/mesh/generated/localonly.pb.h @@ -138,7 +138,7 @@ extern const pb_msgdesc_t LocalModuleConfig_msg; #define LocalModuleConfig_fields &LocalModuleConfig_msg /* Maximum encoded size of messages (where known) */ -#define LocalConfig_size 321 +#define LocalConfig_size 319 #define LocalModuleConfig_size 288 #ifdef __cplusplus diff --git a/src/mesh/http/ContentHandler.cpp b/src/mesh/http/ContentHandler.cpp index c451afe91..bf6c79742 100644 --- a/src/mesh/http/ContentHandler.cpp +++ b/src/mesh/http/ContentHandler.cpp @@ -716,8 +716,6 @@ void handleAdminSettings(HTTPRequest *req, HTTPResponse *res) res->println("