summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-08-16 17:34:55 +0000
committerJens Arnold <amiconn@rockbox.org>2007-08-16 17:34:55 +0000
commit2a258eac6beaaac20c07c26ffe5f39a4c362968e (patch)
tree5497780eaef7c75cfb8d930cf33bd5ce2c35dc50
parentda727b5acec72f93292a86bbecf7bb502e5a8b76 (diff)
downloadrockbox-2a258eac6beaaac20c07c26ffe5f39a4c362968e.tar.gz
rockbox-2a258eac6beaaac20c07c26ffe5f39a4c362968e.tar.bz2
rockbox-2a258eac6beaaac20c07c26ffe5f39a4c362968e.zip
Fix signedness bug in trickle charge proportional adjustment which became visible due to the changed calculation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14371 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/powermgmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 596922f891..570fcfa065 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -1139,7 +1139,7 @@ static void power_thread(void)
* generate more heat [gvb].
*/
- pid_p = (target_voltage - battery_millivolts) / 5;
+ pid_p = ((signed)target_voltage - (signed)battery_millivolts) / 5;
if((pid_p <= PID_DEADZONE) && (pid_p >= -PID_DEADZONE))
pid_p = 0;