Initial commit.

This commit is contained in:
Christoph Lohmann
2017-09-10 19:28:54 +02:00
commit a175162278
7 changed files with 399 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
/*
* gettemperature("/sys/class/hwmon/hwmon0/device", "temp1_input");
*/
char *
gettemperature(char *base, char *sensor)
{
char *co;
co = readfile(base, sensor);
if (co == NULL)
return smprintf("");
return smprintf("%02.0f°C", atof(co) / 1000);
}