update for multicpu sensors

SVN revision: 49079
This commit is contained in:
Mike Blumenkrantz 2010-05-20 21:31:44 +00:00
parent 19e7a56f65
commit 6932b46ccf
1 changed files with 13 additions and 2 deletions

View File

@ -17,6 +17,7 @@ temperature_udev_update(void *data)
char *syspath;
const char *test;
char buf[256];
int cpus = 0;
inst = data;
temp = -999;
@ -38,11 +39,21 @@ temperature_udev_update(void *data)
{
temp = 0;
EINA_LIST_FOREACH(inst->tempdevs, l, syspath)
{
{/*FIXME: probably should make a function to count the cpus and loop this */
if ((test = eeze_udev_syspath_get_sysattr(syspath, "temp1_input")))
temp += (strtod(test, NULL) / 1000); /* udev reports temp in (celcius * 1000) for some reason */
if ((test = eeze_udev_syspath_get_sysattr(syspath, "temp2_input")))
{
temp += (strtod(test, NULL) / 1000); /* udev reports temp in (celcius * 1000) for some reason */
cpus++;
}
if ((test = eeze_udev_syspath_get_sysattr(syspath, "temp3_input")))
{
temp += (strtod(test, NULL) / 1000); /* udev reports temp in (celcius * 1000) for some reason */
cpus++;
}
}
temp /= (double)eina_list_count(inst->tempdevs);
temp /= (double)(eina_list_count(inst->tempdevs) + cpus);
}
if (temp != -999)
{