fixes for power kernel 47 breaking temperature and voltage readings
authorlance colton <lance.colton@gmail.com>
Mon, 23 May 2011 23:04:49 +0000 (17:04 -0600)
committerlance colton <lance.colton@gmail.com>
Mon, 23 May 2011 23:04:49 +0000 (17:04 -0600)
debian/changelog
src/linux.c
src/text_object.c

index bf1c4df..c93f0b5 100644 (file)
@@ -1,9 +1,19 @@
-conky (1.9.6-1) unstable; urgency=low
+conky (1.9.7-1) unstable; urgency=low
 
   * New maemo release:
-    - i'm too lazy to fill this in for now
-    - did i mention lazy? 
-      + whatever
+    - fixes for power kernel v47 
+      + temperature and voltage are reported differently by this kernel and needed to be adjusted
+      + temperature is now reported to the tenth of the degree and your conf file may need to be adjusted to account for this additional digit
+
+ -- Lance Colton <lance.colton@gmail.com>  Mon, 23 May 2011 16:00:00 -0700
+
+conky (1.9.6-2) unstable; urgency=low
+
+  * New maemo release:
+    - too many changes to list
+    - equivalent to 1.8.2 on master conky branch with lots of n900 fixes 
+      + see http://talk.maemo.org/showthread.php?t=64434
+      + the deb posted there is actually better as it supports lua, autobuilder can't work with that
 
  -- Lance Colton <lance.colton@gmail.com>  Thu, 21 Oct 2010 12:00:00 -0700
  
index c2755c7..e394879 100644 (file)
@@ -1592,8 +1592,8 @@ static unsigned char last_cell_radio_percent;
 //eg 'full' 'on' 'off'
 static char last_batt_charge_status[16];
 
-//eg 35
-static int last_battery_temp[MAX_BATTERY_COUNT];
+//eg 35.5
+static float last_battery_temp[MAX_BATTERY_COUNT];
 
 /* e.g. "charging 75%" */
 static char last_battery_str[MAX_BATTERY_COUNT][64];
@@ -1927,10 +1927,12 @@ void get_battery_stuff(char *buffer, unsigned int n, const char *bat, int item)
                }
                fclose(sysfs_bat_fp[idx]);
                sysfs_bat_fp[idx] = NULL;
-
-               last_battery_volts[idx] = voltage;
-               last_battery_temp[idx] = temp;
-
+               if (voltage > 10000) voltage = voltage / 1000;  //fix for n900 power kernel 47
+               last_battery_volts[idx] = voltage;
+               if (temp < 100)
+                       last_battery_temp[idx] = temp;
+               else //fix for n900 power kernel 47
+                       last_battery_temp[idx] = (float) temp / 10;
                /* charging */
                if (present_rate <= 0) {
                                /* e.g. charging 75% */
@@ -1980,7 +1982,7 @@ void set_return_value(char *buffer, unsigned int n, int item, int idx)
                        snprintf(buffer, n, "%i", last_battery_volts[idx]); // voltage
                        break;
                case BATTERY_TEMP:
-                       snprintf(buffer, n, "%i", last_battery_temp[idx]); // temperature
+                       snprintf(buffer, n, "%3.1f", last_battery_temp[idx]); // temperature
                        break;
                default:
                        fprintf (stderr, "invalid item type in set_return_value");
index 7bc625b..a34f74a 100644 (file)
@@ -55,7 +55,7 @@ int append_object(struct text_object *root, struct text_object *obj)
 
        if (end) {
                if (end->next)
-                       CRIT_ERR(NULL, NULL, "huston, we have a lift-off");
+                       CRIT_ERR(NULL, NULL, "houston, we have a lift-off");
                end->next = obj;
        } else {
                root->next = obj;