Esempio 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;
}
Esempio 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;
}
Esempio n. 3
0
void ProgramData::changeVoltage(int direction)
{
    uint16_t max = getMaxCells();
    change0ToMaxSmart(battery.cells, direction, max, battery.type == Unknown ? 50: 0);
}
Esempio n. 4
0
void ProgramData::changeVoltage(int direction)
{
    uint16_t max = getMaxCells();
    changeMaxSmart(battery.cells, direction, max);
}