summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;