From 71eb1d321d1937b9fc96891fa47211a9e65a1e5e Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Mon, 30 Apr 2018 15:14:37 +0200 Subject: temperature: OS split --- components/Linux/temperature.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 components/Linux/temperature.c (limited to 'components/Linux/temperature.c') diff --git a/components/Linux/temperature.c b/components/Linux/temperature.c new file mode 100644 index 0000000..fa50826 --- /dev/null +++ b/components/Linux/temperature.c @@ -0,0 +1,15 @@ +/* See LICENSE file for copyright and license details. */ +#include +#include +#include + +#include "../../util.h" + +const char * +temp(const char *file) +{ + int temp; + + return (pscanf(file, "%d", &temp) == 1) ? + bprintf("%d", temp / 1000) : NULL; +} -- cgit v1.2.3