mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 09:59:01 +00:00
parent
32d92d9b75
commit
397030b5a6
@ -296,16 +296,7 @@ uint32_t GPS::getWakeTime() const
|
|||||||
|
|
||||||
if (t == UINT32_MAX)
|
if (t == UINT32_MAX)
|
||||||
return t; // already maxint
|
return t; // already maxint
|
||||||
|
return t * 1000;
|
||||||
if (t == 0)
|
|
||||||
t = (config.device.role == Config_DeviceConfig_Role_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
|
|
||||||
|
|
||||||
return t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get how long we should sleep between aqusition attempts in msecs
|
/** Get how long we should sleep between aqusition attempts in msecs
|
||||||
@ -320,14 +311,8 @@ uint32_t GPS::getSleepTime() const
|
|||||||
|
|
||||||
if (t == UINT32_MAX)
|
if (t == UINT32_MAX)
|
||||||
return t; // already maxint
|
return t; // already maxint
|
||||||
|
|
||||||
if (t == 0) // default - unset in preferences
|
return t * 1000;
|
||||||
t = (config.device.role == Config_DeviceConfig_Role_ROUTER) ? 24 * 60 * 60
|
|
||||||
: 2 * 60; // 2 mins or once per day for routers
|
|
||||||
|
|
||||||
t *= 1000;
|
|
||||||
|
|
||||||
return t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPS::publishUpdate()
|
void GPS::publishUpdate()
|
||||||
|
@ -184,6 +184,7 @@ void NodeDB::installDefaultConfig()
|
|||||||
void NodeDB::initConfigIntervals()
|
void NodeDB::initConfigIntervals()
|
||||||
{
|
{
|
||||||
config.position.gps_update_interval = default_gps_update_interval;
|
config.position.gps_update_interval = default_gps_update_interval;
|
||||||
|
config.position.gps_attempt_time = default_gps_attempt_time;
|
||||||
config.position.position_broadcast_secs = default_broadcast_interval_secs;
|
config.position.position_broadcast_secs = default_broadcast_interval_secs;
|
||||||
|
|
||||||
config.power.ls_secs = default_ls_secs;
|
config.power.ls_secs = default_ls_secs;
|
||||||
|
@ -175,12 +175,15 @@ extern NodeDB nodeDB;
|
|||||||
|
|
||||||
#define IF_ROUTER(routerVal, normalVal) ((config.device.role == Config_DeviceConfig_Role_ROUTER) ? (routerVal) : (normalVal))
|
#define IF_ROUTER(routerVal, normalVal) ((config.device.role == Config_DeviceConfig_Role_ROUTER) ? (routerVal) : (normalVal))
|
||||||
|
|
||||||
#define default_gps_update_interval IF_ROUTER(30, 15 * 60)
|
#define ONE_DAY 24 * 60 * 60
|
||||||
#define default_broadcast_interval_secs IF_ROUTER(12 * 60 * 60, 15 * 60)
|
|
||||||
|
#define default_gps_attempt_time IF_ROUTER(5 * 60, 15 * 60)
|
||||||
|
#define default_gps_update_interval IF_ROUTER(ONE_DAY, 2 * 60)
|
||||||
|
#define default_broadcast_interval_secs IF_ROUTER(ONE_DAY / 2, 15 * 60)
|
||||||
#define default_wait_bluetooth_secs IF_ROUTER(1, 60)
|
#define default_wait_bluetooth_secs IF_ROUTER(1, 60)
|
||||||
#define default_mesh_sds_timeout_secs IF_ROUTER(NODE_DELAY_FOREVER, 2 * 60 * 60)
|
#define default_mesh_sds_timeout_secs IF_ROUTER(NODE_DELAY_FOREVER, 2 * 60 * 60)
|
||||||
#define default_sds_secs 365 * 24 * 60 * 60
|
#define default_sds_secs 365 * ONE_DAY
|
||||||
#define default_ls_secs IF_ROUTER(24 * 60 * 60, 5 * 60)
|
#define default_ls_secs IF_ROUTER(ONE_DAY, 5 * 60)
|
||||||
#define default_min_wake_secs 10
|
#define default_min_wake_secs 10
|
||||||
#define default_screen_on_secs 60 * 10
|
#define default_screen_on_secs 60 * 10
|
||||||
|
|
||||||
|
@ -415,6 +415,7 @@ void RadioInterface::applyModemConfig()
|
|||||||
if (power == 0)
|
if (power == 0)
|
||||||
power = 17; // Default to default power if we don't have a valid power
|
power = 17; // Default to default power if we don't have a valid power
|
||||||
|
|
||||||
|
// Set final tx_power back onto config
|
||||||
loraConfig.tx_power = power;
|
loraConfig.tx_power = power;
|
||||||
|
|
||||||
// Calculate the number of channels
|
// Calculate the number of channels
|
||||||
|
Loading…
Reference in New Issue
Block a user