Ejemplo n.º 1
0
void ProgramData::check()
{
    uint16_t v;

    v = getMaxCells();
    if(battery.cells > v) battery.cells = v;

    v = getMaxIc();
    if(battery.Ic > v) battery.Ic = v;

    v = getMaxId();
    if(battery.Id > v) battery.Id = v;
}
Ejemplo n.º 2
0
void ProgramData::check()
{
    uint16_t v;

    v = ANALOG_MIN_CHARGE;
    if(battery.capacity < v) battery.capacity = v;
    v = ANALOG_MAX_CHARGE;
    if(battery.capacity > v) battery.capacity = v;

#ifdef ENABLE_TIME_LIMIT
    v = ANALOG_MAX_TIME_LIMIT;
    if(battery.time > v) battery.time = v;
#endif

    v = getMaxCells();
    if(battery.cells > v) battery.cells = v;
    v = 1;
    if(battery.cells < v) battery.cells = v;


    v = getMaxIc();
    if(battery.Ic > v) battery.Ic = v;
    v = battery.Ic;
    if(battery.minIc > v) battery.minIc = v;

    v = getMaxId();
    if(battery.Id > v) battery.Id = v;
    v = battery.Id;
    if(battery.minId > v) battery.minId = v;

    v = settings.minIc;
    if(battery.Ic < v) battery.Ic = v;
    if(battery.minIc < v) battery.minIc = v;

    v = settings.minId;
    if(battery.Id < v) battery.Id = v;
    if(battery.minId < v) battery.minId = v;
}
Ejemplo n.º 3
0
void ProgramData::changeIc(int direction)
{
    change0ToMaxSmart(battery.Ic, direction, getMaxIc());
}