Skip to content

Commit

Permalink
Improve logging of TempSensor
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Spannagel committed May 4, 2024
1 parent ea1e9ae commit 5982d0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hardware/TempSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ class TempSensor {
* @brief Small helper method to be wrapped in a timer for updating the temperature from the sensors
*/
void update_temperature_reading() {
LOG(TRACE, "Attempting temperature reading");
// Update temperature and detect errors:
auto updated = sample_temperature(last_temperature_);
if (updated) {
LOGF(DEBUG, "Temperature reading successful: %.1f", last_temperature_);
LOGF(TRACE, "Temperature reading successful: %.1f", last_temperature_);

// Reset error counter and error state
bad_readings_ = 0;
Expand All @@ -85,6 +84,7 @@ class TempSensor {
}
else if (!error_) {
// Increment error counter
LOGF(DEBUG, "Error during temperature reading, incrementing error counter to %i", bad_readings_);
bad_readings_++;
}

Expand Down

0 comments on commit 5982d0c

Please sign in to comment.