diff --git a/src/airtime.cpp b/src/airtime.cpp index 59882078..fed4ef8a 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 6491e364..f6b9bdcb 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)