-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtemperature.tbl
30 lines (29 loc) · 1.08 KB
/
temperature.tbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// ****************************************************************************
// temperature.tbl ELFE project
// ****************************************************************************
//
// File Description:
//
// The module for temperature
//
//
//
//
//
//
//
//
// ****************************************************************************
// (C) 2015 Christophe de Dinechin <[email protected]>
// (C) 2015 Taodyne SAS
// ****************************************************************************
NAME_FN(Temperature, // Unique internal name
real, // Return value
"temperature", // Name for ELFE programmers
// ----------------------------------------------------------------------------
// Return the core temperature as reported by the Linux kernel
// ----------------------------------------------------------------------------
std::ifstream is("/sys/class/thermal/thermal_zone0/temp");
int tval;
is >> tval;
R_REAL(tval * 0.001));