/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / battery display in V1.7

Username:     
Password:     
             

Forum

# 1   2008-09-10 13:29:43 battery display in V1.7

jacques
Member
Registered: 2008-09-02
Posts: 10

battery display in V1.7

In circle OS 1.7 the battery display never change, even a few seconds before shut down.

In fact Vbatt function does not report VBatt but the value at AD input wich is 1/2 Vbatt.
that is about 1500mV.

In the display function, 2000 is substracted from Vbatt, so result give a negative number wich is stored in an unsigned var.
so the next test ( >20 ) is always true and displayed is always 20, so full battery.

in draw.c

BatState = UTIL_GetBat();
...
      widthBat    = ( 2 * ( BatState - 2000 ) ) / 70 ;
      if( widthBat > 20 )         {         widthBat = 20;         }



Fixed in V2.0 ?

Last edited by jacques (2008-09-10 13:33:03)

Offline

 

# 2   2008-09-15 10:05:07 battery display in V1.7

matloub
Member
Registered: 2008-02-21
Posts: 98

Re: battery display in V1.7

Hi

I think his part has not been modified.
Thank you for reporting this point.


Matloub

Offline

 

Board footer