GomerS
|
2011-01-13
, 16:29
|
Posts: 6 |
Thanked: 1 time |
Joined on Oct 2010
|
#131
|
The Following User Says Thank You to GomerS For This Useful Post: | ||
|
2011-01-14
, 15:32
|
|
Posts: 670 |
Thanked: 359 times |
Joined on May 2007
|
#132
|
The Following 8 Users Say Thank You to fnordianslip For This Useful Post: | ||
|
2011-04-20
, 23:26
|
|
Posts: 543 |
Thanked: 802 times |
Joined on Apr 2010
@ Germany
|
#133
|
The Following User Says Thank You to helex For This Useful Post: | ||
|
2011-04-27
, 19:16
|
Posts: 1,463 |
Thanked: 1,916 times |
Joined on Feb 2008
@ Edmonton, AB
|
#134
|
The Following 2 Users Say Thank You to Creamy Goodness For This Useful Post: | ||
|
2011-04-27
, 22:57
|
|
Posts: 543 |
Thanked: 802 times |
Joined on Apr 2010
@ Germany
|
#135
|
Sorry, I was away for a few days, didn't have time to reply until now.
The official Conky probably doesn't support this, just google the official docs and double check, but I don't remember anything like that.
The Conky source code is fairly confusing to me, I'm not used to pointers and custom data structres so I can't really make any quick changes to the flow of the program. I have to reinstall all the development tools first anyways, so I can't even try at the moment. Let me know if the official Conky gets updated though, I can update ours with any new features they add unless they make it incompatible somehow.
|
2011-05-11
, 02:13
|
Posts: 804 |
Thanked: 1,598 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#136
|
while (!feof(sysfs_bat_fp[idx])) {
//we are looping through the data here
char buf[256];
if (fgets(buf, 256, sysfs_bat_fp[idx]) == NULL)
break;
if (strncmp (buf, "POWER_SUPPLY_PRESENT=1", 22) == 0)//does current row match this?
strcpy(present, "yes");//n900 always yes
else if (strncmp(buf, "POWER_SUPPLY_VOLTAGE_NOW=", 25) == 0)//keep checking possible matches
sscanf(buf, "POWER_SUPPLY_VOLTAGE_NOW=%d", &voltage);
else if (strncmp(buf, "POWER_SUPPLY_CURRENT_NOW=", 25) == 0)
sscanf(buf, "POWER_SUPPLY_CURRENT_NOW=%d", &present_rate);
else if (strncmp(buf, "POWER_SUPPLY_CAPACITY=", 22) == 0)
sscanf(buf, "POWER_SUPPLY_CAPACITY=%d", &remaining_capacity);
else if (strncmp(buf, "POWER_SUPPLY_TEMP=", 18) == 0)
sscanf(buf, "POWER_SUPPLY_TEMP=%d", &temp);
}
fclose(sysfs_bat_fp[idx]);
sysfs_bat_fp[idx] = NULL;
last_battery_volts[idx] = voltage;
last_battery_temp[idx] = temp;
while (!feof(sysfs_bat_fp[idx])) {
//we are looping through the data here
char buf[256];
if (fgets(buf, 256, sysfs_bat_fp[idx]) == NULL)
break;
if (strncmp (buf, "POWER_SUPPLY_PRESENT=1", 22) == 0)//does current row match this?
strcpy(present, "yes");//n900 always yes
else if (strncmp(buf, "POWER_SUPPLY_VOLTAGE_NOW=", 25) == 0)//keep checking possible matches
sscanf(buf, "POWER_SUPPLY_VOLTAGE_NOW=%d", &voltage);
else if (strncmp(buf, "POWER_SUPPLY_CURRENT_NOW=", 25) == 0)
sscanf(buf, "POWER_SUPPLY_CURRENT_NOW=%d", &present_rate);
else if (strncmp(buf, "POWER_SUPPLY_CAPACITY=", 22) == 0)
sscanf(buf, "POWER_SUPPLY_CAPACITY=%d", &remaining_capacity);
else if (strncmp(buf, "POWER_SUPPLY_TEMP=", 18) == 0)
sscanf(buf, "POWER_SUPPLY_TEMP=%d", &temp);
}
fclose(sysfs_bat_fp[idx]);
sysfs_bat_fp[idx] = NULL;
if(voltage>10000)
last_battery_volts[idx] = voltage/1000;
else
last_battery_volts[idx] = voltage;
if(temp>100)
last_battery_temp[idx] = temp/10;
else
last_battery_temp[idx] = temp;
The Following 10 Users Say Thank You to misiak For This Useful Post: | ||
|
2011-05-11
, 07:06
|
Posts: 1,463 |
Thanked: 1,916 times |
Joined on Feb 2008
@ Edmonton, AB
|
#137
|
|
2011-05-11
, 09:50
|
Posts: 804 |
Thanked: 1,598 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#138
|
I didn't know that, I haven't tried the new kernel yet.
You should check if the voltage is > 1000 or the temp is > 100 before trying to divide it.
if(voltage>10000)
last_battery_volts[idx] = voltage/1000;
else
last_battery_volts[idx] = voltage;
if(temp>100)
last_battery_temp[idx] = temp/10;
else
last_battery_temp[idx] = temp;
|
2011-05-13
, 16:08
|
Posts: 1,463 |
Thanked: 1,916 times |
Joined on Feb 2008
@ Edmonton, AB
|
#139
|
|
2011-05-14
, 18:00
|
Posts: 804 |
Thanked: 1,598 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#140
|
Well, I am pretty much the maintainer. I wrote that chunk of code you modified, and I was trying to get you to fix it properly and test it since you have that 47 kernel installed and I don't. This weekend I will double check it works fine on the existing kernel, and see if we can get the change pushed out to everyone.