From 75bf2cc9c63674a94e37ad087d86125c2f1ffc82 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Wed, 2 Mar 2022 20:38:14 -0800 Subject: [PATCH] Update PERIODS_TO_LOG --- src/airtime.cpp | 6 +++--- src/airtime.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/airtime.cpp b/src/airtime.cpp index 598820782..fed4ef8aa 100644 --- a/src/airtime.cpp +++ b/src/airtime.cpp @@ -31,7 +31,7 @@ void AirTime::logAirtime(reportTypes reportType, uint32_t airtime_ms) uint8_t AirTime::currentPeriodIndex() { - return ((getSecondsSinceBoot() / SECONDS_PER_PERIOD) % myNodeInfo.air_period_rx_count); + return ((getSecondsSinceBoot() / SECONDS_PER_PERIOD) % PERIODS_TO_LOG); } uint8_t AirTime::getPeriodUtilMinute() { @@ -48,7 +48,7 @@ void AirTime::airtimeRotatePeriod() if (this->airtimes.lastPeriodIndex != this->currentPeriodIndex()) { DEBUG_MSG("Rotating airtimes to a new period = %u\n", this->currentPeriodIndex()); - for (int i = myNodeInfo.air_period_rx_count - 2; i >= 0; --i) { + for (int i = PERIODS_TO_LOG - 2; i >= 0; --i) { this->airtimes.periodTX[i + 1] = this->airtimes.periodTX[i]; this->airtimes.periodRX[i + 1] = this->airtimes.periodRX[i]; this->airtimes.periodRX_ALL[i + 1] = this->airtimes.periodRX_ALL[i]; @@ -83,7 +83,7 @@ uint32_t *AirTime::airtimeReport(reportTypes reportType) uint8_t AirTime::getPeriodsToLog() { - return myNodeInfo.air_period_rx_count; + return PERIODS_TO_LOG; } uint32_t AirTime::getSecondsPerPeriod() diff --git a/src/airtime.h b/src/airtime.h index 6491e3648..f6b9bdcb5 100644 --- a/src/airtime.h +++ b/src/airtime.h @@ -26,7 +26,7 @@ #define CHANNEL_UTILIZATION_PERIODS 6 #define SECONDS_PER_PERIOD 3600 -#define PERIODS_TO_LOG 24 +#define PERIODS_TO_LOG 8 #define MINUTES_IN_HOUR 60 #define SECONDS_IN_MINUTE 60 #define MS_IN_HOUR (MINUTES_IN_HOUR * SECONDS_IN_MINUTE * 1000)