X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=firmware%2Fbattery.c;h=01337db1bb8c196fde0d0ff3efa61b1457bce7a8;hb=9e483c6969d2cdce60f6dcc3d167fec889a48993;hp=284c096b34230b38f53702539d6ed4792f901dcb;hpb=b0e6a5b47836a04116631e3a5427b8a508fc5cbf;p=bike-lights.git 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 }