Fixed to call getMCUTemperature once.
This commit is contained in:
@@ -174,9 +174,9 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t
|
|||||||
telemetry.reset();
|
telemetry.reset();
|
||||||
telemetry.addVoltage(TELEM_CHANNEL_SELF, (float)board.getBattMilliVolts() / 1000.0f);
|
telemetry.addVoltage(TELEM_CHANNEL_SELF, (float)board.getBattMilliVolts() / 1000.0f);
|
||||||
|
|
||||||
float temperature = (float)board.getMCUTemperature();
|
float temperature = board.getMCUTemperature();
|
||||||
if(!isnan(temperature)) { // Supported boards with built-in temperature sensor. ESP32-C3 may return NAN
|
if(!isnan(temperature)) { // Supported boards with built-in temperature sensor. ESP32-C3 may return NAN
|
||||||
telemetry.addTemperature(TELEM_CHANNEL_SELF, (float)board.getMCUTemperature()); // Built-in MCU Temperature
|
telemetry.addTemperature(TELEM_CHANNEL_SELF, temperature); // Built-in MCU Temperature
|
||||||
}
|
}
|
||||||
|
|
||||||
// query other sensors -- target specific
|
// query other sensors -- target specific
|
||||||
|
|||||||
Reference in New Issue
Block a user