Merge pull request #1274 from IoTThinks/MCdev-FixedMCUTemperature

To fix MCU Temperature for repeaters
This commit is contained in:
ripplebiz 2025-12-29 15:05:31 +11:00 committed by GitHub
commit 1c594d4cbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 6 deletions

View file

@ -44,7 +44,14 @@ public:
// Temperature from ESP32 MCU
float getMCUTemperature() override {
return temperatureRead();
uint32_t raw = 0;
// To get and average the temperature so it is more accurate, especially in low temperature
for (int i = 0; i < 4; i++) {
raw += temperatureRead();
}
return raw / 4;
}
uint8_t getStartupReason() const override { return startup_reason; }