Skip to content

Commit

Permalink
Merge pull request #1 from kolakao/master
Browse files Browse the repository at this point in the history
Make CPUTempMeter compatible with Orange Pi boards
  • Loading branch information
wbenny committed Jan 14, 2018
2 parents bb70259 + db4851e commit d87d5c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions linux/CPUTempMeter.c
Expand Up @@ -42,8 +42,9 @@ static void CPUTempMeter_updateValues(Meter* this, char* buffer, int len) {
double temperature;
temperature = strtod(line, NULL);
free(line);

temperature /= 1000.0;
// some of the systems(e.g Orange Pi) show real temperature in Celcius and therefore we do not need to divide by 1000
if (temperature > 1000.0) temperature /= 1000.0;

this->values[0] = temperature;

snprintf(buffer, len, "%d/%d", (int)this->values[0], (int)this->total);
Expand Down

0 comments on commit d87d5c0

Please sign in to comment.