From c919c204874b9455471744eb6b802534ed629fcc Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Wed, 27 Feb 2013 23:27:46 +0100 Subject: [PATCH] battery.c: priority of operations ... in order to fit to an 8-bit value. --- firmware/battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/battery.c b/firmware/battery.c index 284c096..01337db 100644 --- a/firmware/battery.c +++ b/firmware/battery.c @@ -23,8 +23,8 @@ void battery_adc(uint16_t adcval) * is coarse (0.1 V). */ battery_100mv = (unsigned char) - ((uint16_t)(adcval * 11 // 1.1V + ((uint16_t)(adcval * (11 // 1.1V * (RESISTOR_HI+RESISTOR_LO)/RESISTOR_LO // resistor ratio - / 4) >> 8); // divide by 1024 + / 4)) >> 8); // divide by 1024 } -- 2.39.3