Remove is_always_pwoered (#1525)

raytac-diy
Ben Meadors 2022-06-17 13:35:12 -05:00 zatwierdzone przez GitHub
rodzic 9285316c78
commit 52f299ec49
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
6 zmienionych plików z 8 dodań i 14 usunięć

@ -1 +1 @@
Subproject commit 94a4dbb842961e75f89de13dc6d0437a256098aa
Subproject commit 274aa01a3862ee83b1ae791c36205e661c4af7ca

Wyświetl plik

@ -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);

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -716,8 +716,6 @@ void handleAdminSettings(HTTPRequest *req, HTTPResponse *res)
res->println("<tr><td><input type=checkbox></td><td>WiFi Password</td><td>false</td><td><input type=radio></td></tr>\n");
res->println(
"<tr><td><input type=checkbox></td><td>Smart Position Update</td><td>false</td><td><input type=radio></td></tr>\n");
res->println("<tr><td><input type=checkbox></td><td>is_always_powered</td><td>false</td><td><input type=radio></td></tr>\n");
res->println("<tr><td><input type=checkbox></td><td>is_always_powered</td><td>false</td><td><input type=radio></td></tr>\n");
res->println("</table>\n");
res->println("<table>\n");
res->println("<input type=submit value=Apply New Settings>\n");

Wyświetl plik

@ -392,7 +392,6 @@ StoreForwardModule::StoreForwardModule()
*/
moduleConfig.store_forward.enabled = 1;
config.power.is_always_powered = 1;
}
if (moduleConfig.store_forward.enabled) {