示例#1
0
    virtual void editItem(uint8_t index, uint8_t key) {
        int dir = -1;
        if(key == BUTTON_INC) dir = 1;
//        dir *= Keyboard::getSpeedFactor();
        change0ToMaxSmart(value_, dir, maxValue_, 1);
        setCurrentValue(cName_, value_);
    }
示例#2
0
void ProgramData::changeCharge(int direction)
{
    change0ToMaxSmart(battery.C, direction, PROGRAM_DATA_MAX_CHARGE);
    battery.Ic = battery.C;
    if(isPb())
        battery.Ic/=4; //0.25C
    battery.Id = battery.C;
    check();
}
void SettingsMenu::editItem(uint8_t index, uint8_t key)
{
    int dir = -1;
    if(key == BUTTON_INC) dir = 1;
//    dir *= keyboard.getSpeedFactor();
    START_CASE_COUNTER;
    switch(index) {
#ifdef ENABLE_LCD_BACKLIGHT
        case NEXT_CASE:     changeBacklight(dir);                                   break;
#endif
#ifdef ENABLE_FAN
        case NEXT_CASE:     changeTemp(p_.fanTempOn_, dir);                         break;
#endif
#ifdef ENABLE_T_INTERNAL
        case NEXT_CASE:     changeTemp(p_.dischargeTempOff_, dir);                  break;
#endif
        case NEXT_CASE:     change0ToMax(p_.externT_, dir, 1);                      break;
        case NEXT_CASE:     changeTemp(p_.externTCO_,dir);                          break;
        case NEXT_CASE:     changeDeltaTemp(p_.deltaT_,dir);                        break;
        case NEXT_CASE:     change0ToMax(p_.enable_deltaV_, dir, 1);                break;
        case NEXT_CASE:     change0ToMax(p_.deltaV_NiMH_, dir, 20);                 break;
        case NEXT_CASE:     change0ToMax(p_.deltaV_NiCd_, dir, 20);                 break;
        case NEXT_CASE:     change1ToMax(p_.CDcycles_, dir, 5);                     break;
        case NEXT_CASE:     change1ToMax(p_.WasteTime_, dir, 99);                   break;
#ifdef ENABLE_MUTEAUDIO        
        case NEXT_CASE:     change0ToMax(p_.AudioBeep_, dir, 1);                    break;
#endif
        case NEXT_CASE:     changeIMin(p_.Lixx_Imin_, dir);                         break;
        case NEXT_CASE:     change1ToMax(p_.capCutoff_, dir, 250);                  break;
        case NEXT_CASE:     changeInputVolt(p_.inputVoltageLow_, dir);              break;
        case NEXT_CASE:     change0ToMaxSmart(p_.dischargeOffset_LiXX_, dir, Settings::MaxDischargeOffset_LiXX);  break;
        case NEXT_CASE:     change0ToMax(p_.dischargeAggressive_LiXX_, dir, 1);     break;
        case NEXT_CASE:     change0ToMax(p_.forceBalancePort_, dir, 1);             break;
        case NEXT_CASE:     changeBalanceError(p_.balancerError_, dir);             break;
        case NEXT_CASE:     change0ToMax(p_.UART_, dir, Settings::ExtDebugAdc);     break;
        case NEXT_CASE:     change0ToMax(p_.UARTspeed_, dir, Settings::UARTSpeeds-1); break;
    }
}
示例#4
0
void ProgramData::changeId(int direction)
{
    change0ToMaxSmart(battery.Id, direction, getMaxId());
}
示例#5
0
void ProgramData::changeVoltage(int direction)
{
    uint16_t max = getMaxCells();
    change0ToMaxSmart(battery.cells, direction, max, battery.type == Unknown ? 50: 0);
}