Skip to content

Commit

Permalink
Merge pull request meshtastic#1271 from mc-hamster/router
Browse files Browse the repository at this point in the history
Update PERIODS_TO_LOG
  • Loading branch information
mc-hamster authored Mar 3, 2022
2 parents ee533b2 + 97c76cd commit ef4c01f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/airtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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];
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/airtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ef4c01f

Please sign in to comment.