Merge pull request #1098 from mc-hamster/master

Airtime - calculate ms in a hour in preprocessor
This commit is contained in:
Jm Casler 2022-01-15 12:24:50 -08:00 committed by GitHub
commit 2d8e55a34e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -114,7 +114,7 @@ float AirTime::utilizationTXPercent()
sum += this->utilizationTX[i];
}
return (float(sum) / float(MINUTES_IN_HOUR * 10 * 1000)) * 100;
return (float(sum) / float(MS_IN_HOUR)) * 100;
}
AirTime::AirTime() : concurrency::OSThread("AirTime") {}

View File

@ -28,6 +28,9 @@
#define SECONDS_PER_PERIOD 3600
#define PERIODS_TO_LOG 24
#define MINUTES_IN_HOUR 60
#define SECONDS_IN_MINUTE 60
#define MS_IN_HOUR (MINUTES_IN_HOUR * SECONDS_IN_MINUTE * 1000)
enum reportTypes { TX_LOG, RX_LOG, RX_ALL_LOG };