Finish config transition

This commit is contained in:
Sacha Weatherstone
2022-05-07 20:31:21 +10:00
parent c07976438b
commit 6b0ce6b729
55 changed files with 1417 additions and 2027 deletions

View File

@@ -1,7 +1,7 @@
#include "configuration.h"
#include "SerialConsole.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "configuration.h"
#define Port Serial
@@ -45,7 +45,9 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
bool SerialConsole::checkIsConnected()
{
uint32_t now = millis();
return (now - lastContactMsec) < getPref_phone_timeout_secs() * 1000UL;
return (now - lastContactMsec) < config.payloadVariant.power.phone_timeout_secs
? config.payloadVariant.power.phone_timeout_secs
: default_phone_timeout_secs * 1000UL;
}
/**
@@ -55,10 +57,9 @@ bool SerialConsole::checkIsConnected()
bool SerialConsole::handleToRadio(const uint8_t *buf, size_t len)
{
// Turn off debug serial printing once the API is activated, because other threads could print and corrupt packets
if (!radioConfig.preferences.debug_log_enabled)
if (!config.payloadVariant.device.debug_log_enabled)
setDestination(&noopPrint);
canWrite = true;
return StreamAPI::handleToRadio(buf, len);
}