Thread (11 messages) flat view 11 messages, 3 authors, 2014-01-29

Re: [PATCH 4/7] HID: sony: Add offsets and battery calculations for parsing Dualshock 4 reports sent via Bluetooth.

From: <hidden>
Date: 2014-01-29 21:36:16

When the controller isn't connected to a power source and the battery is
discharging, the battery level is reported from 0 to 9 instead of 1 to 11.
+	battery_capacity = rd[offset] & 0x0F;
 	if (battery_capacity > 10)
 		battery_capacity--;
Hi Frank,
You might want to change this to
--
  	if (battery_capacity > 10)
  		battery_capacity = 10;
--

As the report could return values of 12..15, it's just that you haven't
seen them yet.

It might be that they're just giving a rough estimation based on cell
voltage, which might change over temp/life-time... this would also explain
the slightly lower value when the battery is under load.

It would be nice if they had another bit indicating charging, rather than
relying on the (assumed) voltage measurement. But it is what it is.

Cheers,
Simon.


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help