Debug optimisations

This commit is contained in:
Blaz Kristan
2024-09-10 15:20:34 +02:00
parent 340a9f8b76
commit 20444ee7d5
15 changed files with 84 additions and 114 deletions

View File

@@ -246,8 +246,7 @@ bool checkNTPResponse()
}
uint32_t ntpPacketReceivedTime = millis();
DEBUG_PRINT(F("NTP recv, l="));
DEBUG_PRINTLN(cb);
DEBUG_PRINTF_P(PSTR("NTP recv, l=%d\n"), cb);
byte pbuf[NTP_PACKET_SIZE];
ntpUdp.read(pbuf, NTP_PACKET_SIZE); // read the packet into the buffer
if (!isValidNtpResponse(pbuf)) return false; // verify we have a valid response to client
@@ -493,7 +492,7 @@ void calculateSunriseAndSunset() {
do {
time_t theDay = localTime - retryCount * 86400; // one day back = 86400 seconds
minUTC = getSunriseUTC(year(theDay), month(theDay), day(theDay), latitude, longitude, false);
DEBUG_PRINT(F("* sunrise (minutes from UTC) = ")); DEBUG_PRINTLN(minUTC);
DEBUG_PRINTF_P(PSTR("* sunrise (minutes from UTC) = %d\n"), minUTC);
retryCount ++;
} while ((abs(minUTC) > SUNSET_MAX) && (retryCount <= 3));
@@ -512,7 +511,7 @@ void calculateSunriseAndSunset() {
do {
time_t theDay = localTime - retryCount * 86400; // one day back = 86400 seconds
minUTC = getSunriseUTC(year(theDay), month(theDay), day(theDay), latitude, longitude, true);
DEBUG_PRINT(F("* sunset (minutes from UTC) = ")); DEBUG_PRINTLN(minUTC);
DEBUG_PRINTF_P(PSTR("* sunset (minutes from UTC) = %d\n"), minUTC);
retryCount ++;
} while ((abs(minUTC) > SUNSET_MAX) && (retryCount <= 3));