Added always_powered preference

This commit is contained in:
Ben Meadors
2021-11-06 10:03:10 -05:00
parent 334e14ea4d
commit d6c7ea921a
5 changed files with 16 additions and 6 deletions

View File

@@ -11,6 +11,11 @@
/// 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 (radioConfig.preferences.always_powered) {
return true;
}
bool isRouter = radioConfig.preferences.is_router;
// If we are not a router and we already have AC power go to POWER state after init, otherwise go to ON