mirror of
https://github.com/vale981/yabar
synced 2025-03-05 09:31:39 -05:00
fix #157 by capping battery capacity
This commit is contained in:
parent
9779a5e04b
commit
ce1dea3791
1 changed files with 4 additions and 1 deletions
|
@ -544,8 +544,11 @@ void ya_int_battery(ya_block_t *blk) {
|
||||||
strcpy(startstr, bat_50str);
|
strcpy(startstr, bat_50str);
|
||||||
else if(bat <= 75)
|
else if(bat <= 75)
|
||||||
strcpy(startstr, bat_75str);
|
strcpy(startstr, bat_75str);
|
||||||
else
|
else {
|
||||||
strcpy(startstr, bat_100str);
|
strcpy(startstr, bat_100str);
|
||||||
|
if(bat > 100)
|
||||||
|
bat = 100;
|
||||||
|
}
|
||||||
if(stat == 'C' && blk->internal->option[1])
|
if(stat == 'C' && blk->internal->option[1])
|
||||||
strcat(strcat(startstr, " "), bat_chargestr);
|
strcat(strcat(startstr, " "), bat_chargestr);
|
||||||
sprintf(startstr+strlen(startstr), "%*d", space, bat);
|
sprintf(startstr+strlen(startstr), "%*d", space, bat);
|
||||||
|
|
Loading…
Add table
Reference in a new issue