Skip to content

Commit 6c28421

Browse files
committed
Moving log_ds to debug setting
1 parent 040b3de commit 6c28421

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Firmware/RTK_Everywhere/States.ino

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,8 @@ void stateUpdate()
525525
// If we don't have keys, begin zero touch provisioning
526526
else if (strlen(settings.pointPerfectCurrentKey) == 0 || strlen(settings.pointPerfectNextKey) == 0)
527527
{
528-
log_d("PointPerfect Keys starting WiFi");
528+
if (settings.debugPpCertificate)
529+
systemPrintln("PointPerfect Keys starting WiFi");
529530

530531
// Temporarily limit WiFi connection attempts
531532
wifiOriginalMaxConnectionAttempts = wifiMaxConnectionAttempts;
@@ -550,7 +551,9 @@ void stateUpdate()
550551
// Determine days until next key expires
551552
int daysRemaining =
552553
daysFromEpoch(settings.pointPerfectNextKeyStart + settings.pointPerfectNextKeyDuration + 1);
553-
log_d("Days until keys expire: %d", daysRemaining);
554+
555+
if (settings.debugPpCertificate)
556+
systemPrintf("Days until keys expire: %d\r\n", daysRemaining);
554557

555558
if (checkCertificates() && (daysRemaining > 28 && daysRemaining <= 56))
556559
changeState(STATE_KEYS_DAYS_REMAINING);
@@ -565,7 +568,8 @@ void stateUpdate()
565568

566569
if (online.rtc == false)
567570
{
568-
log_d("Keys Needed. RTC offline. Starting WiFi");
571+
if (settings.debugPpCertificate)
572+
systemPrintln("Keys Needed. RTC offline. Starting WiFi");
569573

570574
// Temporarily limit WiFi connection attempts
571575
wifiOriginalMaxConnectionAttempts = wifiMaxConnectionAttempts;
@@ -581,7 +585,8 @@ void stateUpdate()
581585
settings.lastKeyAttempt = rtc.getEpoch(); // Mark it
582586
recordSystemSettings(); // Record these settings to unit
583587

584-
log_d("Keys Needed. Starting WiFi");
588+
if (settings.debugPpCertificate)
589+
systemPrintln("Keys Needed. Starting WiFi");
585590

586591
// Temporarily limit WiFi connection attempts
587592
wifiOriginalMaxConnectionAttempts = wifiMaxConnectionAttempts;
@@ -606,7 +611,8 @@ void stateUpdate()
606611
{
607612
lBandForceGetKeys = false;
608613

609-
log_d("Force key update. Starting WiFi");
614+
if (settings.debugPpCertificate)
615+
systemPrintln("Force key update. Starting WiFi");
610616

611617
// Temporarily limit WiFi connection attempts
612618
wifiOriginalMaxConnectionAttempts = wifiMaxConnectionAttempts;
@@ -619,7 +625,9 @@ void stateUpdate()
619625

620626
else
621627
{
622-
log_d("Already tried to obtain keys for today");
628+
if (settings.debugPpCertificate)
629+
systemPrintln("Already tried to obtain keys for today");
630+
623631
changeState(
624632
STATE_KEYS_DAYS_REMAINING); // We have valid keys, we've already tried today. No need to try again.
625633
}

0 commit comments

Comments
 (0)