}
#endif
snprintf(buf, sizeof(buf),
- "%s/%s/tempget %i \"%s\" %i",
- e_module_dir_get(temperature_config->module), MODULE_ARCH,
- inst->sensor_type,
- (inst->sensor_name != NULL ? inst->sensor_name : "(null)"),
- inst->poll_interval);
- inst->tempget_exe = ecore_exe_pipe_run(buf,
- ECORE_EXE_PIPE_READ |
- ECORE_EXE_PIPE_READ_LINE_BUFFERED |
- ECORE_EXE_NOT_LEADER,
- inst);
+ "%s/%s/tempget %i \"%s\" %i",
+ e_module_dir_get(temperature_config->module), MODULE_ARCH,
+ inst->sensor_type,
+ (inst->sensor_name != NULL ? inst->sensor_name : "(null)"),
+ inst->poll_interval);
+ inst->tempget_exe =
+ ecore_exe_pipe_run(buf,
+ ECORE_EXE_PIPE_READ |
+ ECORE_EXE_PIPE_READ_LINE_BUFFERED |
+ ECORE_EXE_NOT_LEADER, inst);
#ifdef HAVE_EEZE_UDEV
}
else
- {/*avoid creating a new poller if possible*/
+ {
+ /*avoid creating a new poller if possible*/
if (inst->temp_poller)
- ecore_poller_poller_interval_set(inst->temp_poller, inst->poll_interval);
- else
- inst->temp_poller = ecore_poller_add(ECORE_POLLER_CORE, inst->poll_interval, temperature_udev_update_poll, inst);
+ ecore_poller_poller_interval_set(inst->temp_poller,
+ inst->poll_interval);
+ else
+ {
+ inst->temp_poller =
+ ecore_poller_add(ECORE_POLLER_CORE, inst->poll_interval,
+ temperature_udev_update_poll, inst);
+ }
}
#endif
}
{
Eina_List *files;
char *file;
-
+
/* Search each device for temp*_input, these should be
* temperature devices. */
snprintf(path, sizeof(path), "%s/%s", busdir, name);
files = ecore_file_ls(path);
EINA_LIST_FREE(files, file)
+ {
+ if ((!strncmp("temp", file, 4)) &&
+ (!strcmp("_input", &file[strlen(file) - 6])))
{
- if ((!strncmp("temp", file, 4)) &&
- (!strcmp("_input", &file[strlen(file) - 6])))
- {
- char *f;
-
- snprintf(path, sizeof(path),
- "%s/%s/%s", busdir, name, file);
- f = strdup(path);
+ char *f;
+
+ snprintf(path, sizeof(path),
+ "%s/%s/%s", busdir, name, file);
+ f = strdup(path);
if (f) result = eina_list_append(result, f);
}
free(file);
}
-
free(name);
}
}
EINA_LIST_FOREACH_SAFE(inst->tempdevs, l, l2, syspath)
{
if ((eeze_udev_syspath_get_sysattr(syspath, "fan1_input")) ||
- (eeze_udev_syspath_get_sysattr(syspath, "pwm1_stop_time")))
+ (eeze_udev_syspath_get_sysattr(syspath, "pwm1_stop_time")))
{
eina_stringshare_del(syspath);
inst->tempdevs = eina_list_remove_list(inst->tempdevs, l);
{
temp = 0;
EINA_LIST_FOREACH(inst->tempdevs, l, syspath)
- {/*FIXME: probably should make a function to count the cpus and loop this */
+ {
+ /*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 (temp != -999)
{
- if (inst->units == FAHRENHEIT)
- temp = (temp * 9.0 / 5.0) + 32;
+ if (inst->units == FAHRENHEIT)
+ temp = (temp * 9.0 / 5.0) + 32;
if (!inst->have_temp)
{
snprintf(buf, sizeof(buf), "%3.2f°C", temp);
_temperature_face_level_set(inst,
- (double)(temp - inst->low) /
- (double)(inst->high - inst->low));
+ (double)(temp - inst->low) /
+ (double)(inst->high - inst->low));
edje_object_part_text_set(inst->o_temp, "e.text.reading", buf);
}
else