begin cleanup of sleep code for new state machine

This commit is contained in:
geeksville
2020-02-21 17:01:26 -08:00
parent 4fa6b64c3d
commit 045529d91f
11 changed files with 345 additions and 269 deletions
+9 -3
View File
@@ -49,8 +49,13 @@ void NodeDB::init()
devicestate.node_db_count = 0;
devicestate.receive_queue_count = 0;
radioConfig.preferences.send_owner_secs = 60 * 60; // default to once an hour
radioConfig.preferences.position_broadcast_secs = 15 * 60; // default to once every 15 mins
radioConfig.preferences.send_owner_interval = 4; // per sw-design.md
radioConfig.preferences.position_broadcast_secs = 20; // 15 * 60;
radioConfig.preferences.wait_bluetooth_secs = 10; // 30;
radioConfig.preferences.screen_on_secs = 30;
radioConfig.preferences.mesh_sds_timeout_secs = 60 * 60;
radioConfig.preferences.phone_sds_timeout_sec = 60 * 60;
radioConfig.preferences.sds_secs = 60 * 60;
#ifdef GPS_RX_PIN
// some hardware defaults to have a built in GPS
@@ -244,7 +249,8 @@ void NodeDB::updateFrom(const MeshPacket &mp)
switch (p.which_variant)
{
case SubPacket_position_tag: {
case SubPacket_position_tag:
{
// we carefully preserve the old time, because we always trust our local timestamps more
uint32_t oldtime = info->position.time;
info->position = p.variant.position;