move more of is_router out of python and into the device code

This commit is contained in:
Kevin Hester
2020-12-21 11:38:03 +08:00
parent 412916ba7c
commit a8d7700295
6 changed files with 50 additions and 20 deletions

View File

@@ -158,7 +158,7 @@ uint32_t GPS::getWakeTime() const
return t; // already maxint
if (t == 0)
t = 15 * 60; // Allow up to 5 mins for each attempt (probably will be much less if we can find sats)
t = radioConfig.preferences.is_router ? 5 * 60 : 15 * 60; // Allow up to 15 mins for each attempt (probably will be much less if we can find sats) or less if a router
t *= 1000; // msecs
@@ -179,8 +179,8 @@ uint32_t GPS::getSleepTime() const
if (t == UINT32_MAX)
return t; // already maxint
if (t == 0)
t = 2 * 60; // 2 mins
if (t == 0) // default - unset in preferences
t = radioConfig.preferences.is_router ? 24 * 60 * 60 : 2 * 60; // 2 mins or once per day for routers
t *= 1000;