From 81a98e1708a6212d3cbb866ddfe540778f9e74db Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 26 Jan 2007 10:00:03 +0000 Subject: [PATCH] Increase the number of i2c sensors to 4. The only useful one on my motherboard (ASUS A7V333) is the fourth one. Others may find this handy as well. SVN revision: 28123 --- src/modules/temperature/e_mod_config.c | 1 + src/modules/temperature/e_mod_main.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/temperature/e_mod_config.c b/src/modules/temperature/e_mod_config.c index 73c3054eb..34054ae1c 100644 --- a/src/modules/temperature/e_mod_config.c +++ b/src/modules/temperature/e_mod_config.c @@ -127,6 +127,7 @@ _fill_data(E_Config_Dialog_Data *cfdata) ecore_list_append(cfdata->sensors, strdup("temp1")); ecore_list_append(cfdata->sensors, strdup("temp2")); ecore_list_append(cfdata->sensors, strdup("temp3")); + ecore_list_append(cfdata->sensors, strdup("temp4")); ecore_list_goto_first(cfdata->sensors); while ((name = ecore_list_next(cfdata->sensors))) { diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c index 1f07814a1..dec0727b4 100644 --- a/src/modules/temperature/e_mod_main.c +++ b/src/modules/temperature/e_mod_main.c @@ -238,7 +238,7 @@ _temperature_sensor_init(Config_Face *inst) } else { - /* TODO: Is there I2C devices with more than 3 temperature sensors? */ + /* TODO: Is there I2C devices with more than 3 temperature sensors? Yes, mine has 4. */ /* TODO: What to do when there is more than one tempX? */ therms = ecore_file_ls("/sys/bus/i2c/devices"); if (therms) @@ -247,10 +247,10 @@ _temperature_sensor_init(Config_Face *inst) while ((name = ecore_list_next(therms))) { - char *sensors[] = { "temp1", "temp2", "temp3" }; + char *sensors[] = { "temp1", "temp2", "temp3", "temp4" }; int i; - for (i = 0; i < 3; i++) + for (i = 0; i < 4; i++) { sprintf(path, "/sys/bus/i2c/devices/%s/%s_input", name, sensors[i]); @@ -447,7 +447,7 @@ _temperature_cb_check(void *data) if (inst->units == FAHRENHEIT) snprintf(buf, sizeof(buf), "%i°F", temp); else - snprintf(buf, sizeof(buf), "%i°C", temp); + snprintf(buf, sizeof(buf), "%i°C", temp); utf8 = ecore_txt_convert("iso-8859-1", "utf-8", buf); _temperature_face_level_set(inst,