void SettingsMenu::printViewType() const
{
    if(p_.view_ == Screen::Normal)
        lcdPrint_P(PSTR("normal"));
    else
        lcdPrint_P(PSTR("debug"));
}
Example #2
0
    void restoreDefault(bool force) {
        bool calib = false;

        Screen::displayStrings(PSTR("reseting eeprom:"),
                               PSTR("v: " CHEALI_CHARGER_EPPROM_VERSION_STRING " "));

        if(testWriteVersion(&data.calibrationVersion, CHEALI_CHARGER_EEPROM_CALIBRATION_VERSION) || force)  {
            lcdPrint_P(PSTR("c "));
            calib = force = true;
            AnalogInputs::restoreDefault();
        }
        if(testWriteVersion(&data.programDataVersion, CHEALI_CHARGER_EEPROM_PROGRAMDATA_VERSION) || force)  {
            lcdPrint_P(PSTR("d "));
            force = true;
            ProgramData::restoreDefault();
        }
        if(testWriteVersion(&data.settingVersion, CHEALI_CHARGER_EEPROM_SETTINGS_VERSION) || force)  {
            lcdPrint_P(PSTR("s "));
            force = true;
            Settings::restoreDefault();
        }

        if(force)
            Timer::delay(2000);

        if(calib)
            Screen::runCalibrateBeforeUse();
    }
Example #3
0
void lcdPrintYesNo(uint8_t yes)
{
    if(yes)
        lcdPrint_P(PSTR("yes"));
    else
        lcdPrint_P(PSTR(" no"));
}
Example #4
0
void screenEnd(const char * firstLine) {
    lcdSetCursor0_0();
    lcdPrint_P(firstLine);
    lcdPrintTime(Monitor::getTimeSec());
    lcdSetCursor0_1();
    lcdPrint_P(Program::stopReason);
    lcdPrintSpaces();
}
Example #5
0
void Screen::displayScreenTime()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("time:     ")); lcdPrintTime(getTimeSec());
    lcdSetCursor0_1();
    lcdPrint_P(PSTR("b "));
    lcdPrintTime(totalBalanceTime_/1000);
    lcdPrint_P(PSTR("  "));
    lcdPrintTime(totalChargDischargeTime_/1000);
}
Example #6
0
void Screen::runAskResetEeprom(uint8_t what)
{
    lcdClear();
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("eeprom reset:"));
    lcdPrintUInt(what);
    lcdSetCursor0_1();
    lcdPrint_P(PSTR("            yes"));
    while (waitButtonPressed() != BUTTON_START);
}
Example #7
0
void Screen::displayScreenVinput()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("Vinput="));
    analogInputs.printRealValue(AnalogInputs::Vin, 7);
    lcdPrintSpaces();
    lcdSetCursor0_1();
    lcdPrint_P(PSTR(" limit="));
    lcdPrintAnalog(settings.inputVoltageLow_, AnalogInputs::Voltage, 7);
    lcdPrintSpaces();
}
Example #8
0
void Screen::displayScreenVout()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("Vout ="));
    analogInputs.printRealValue(AnalogInputs::Vout, 7);
    lcdPrintSpaces();
    lcdSetCursor0_1();
    lcdPrint_P(PSTR("Vbal.="));
    analogInputs.printRealValue(AnalogInputs::Vbalancer, 7);
    lcdPrintSpaces();
}
Example #9
0
void Screen::displayDeltaVout()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("maxVout="));
    analogInputs.printRealValue(AnalogInputs::deltaVoutMax, 7);
    lcdPrintSpaces();

    lcdSetCursor0_1();
    lcdPrint_P(PSTR("delta V= "));
    deltaV();
}
Example #10
0
void Screen::displayScreenReversedPolarity()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("REVERSE POLARITY"));

    if(settings.isDebug()) {
        lcdSetCursor0_1();
        lcdPrint_P(PSTR("Vrev:"));
        lcdPrintUnsigned(analogInputs.getRealValue(AnalogInputs::VreversePolarity), 8);
    }
}
Example #11
0
void Screen::displayDeltaTextern()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("Text="));
    if(settings.externT_ || settings.isDebug()) {
        lcdPrintTemperature(analogInputs.deltaLastT_, 9);
    } else {
        lcdPrint_P(PSTR("not used"));
    }
    lcdPrintSpaces();

    lcdSetCursor0_1();
    lcdPrint_P(PSTR("delta T= "));
    deltaT();
}
Example #12
0
void Screen::displayScreenR()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("batt. R="));
    lcdPrintResistance(calculateRth_calibrated(theveninMethod.tVout_.Rth_V_, theveninMethod.tVout_.Rth_I_),8);
    lcdPrintSpaces();
    lcdSetCursor0_1();
    if(analogInputs.isConnected(AnalogInputs::Vbalancer)) {
        lcdPrint_P(PSTR("wires R="));
        int16_t Vwires =  analogInputs.getRealValue(AnalogInputs::Vout);
        Vwires -= analogInputs.getRealValue(AnalogInputs::Vbalancer);
        lcdPrintResistance(calculateRth2(Vwires, getI()+1),8);
    }
    lcdPrintSpaces();
}
Example #13
0
void Screen::displayScreenTemperature()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("Text="));
    if(settings.externT_ || settings.isDebug())
        analogInputs.printRealValue(AnalogInputs::Textern,    5);
    else
        lcdPrint_P(PSTR("not used"));
    lcdPrintSpaces();

    lcdSetCursor0_1();
    lcdPrint_P(PSTR("Tint="));
    analogInputs.printRealValue(AnalogInputs::Tintern,    5);
    lcdPrintSpaces();
}
Example #14
0
void Screen::displayDebugBalancerReal0_2()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("0:"));
    analogInputs.printRealValue(AnalogInputs::Vb0_real, 6);
    lcdPrint_P(PSTR("1:"));
    analogInputs.printRealValue(AnalogInputs::Vb1_real, 6);
    lcdPrintSpaces();

    lcdSetCursor0_1();
    lcdPrint_P(PSTR("2:"));
    analogInputs.printRealValue(AnalogInputs::Vb2_real, 6);
    lcdPrint_P(PSTR(" real"));
    lcdPrintSpaces();
}
Example #15
0
void lcdPrint_mV(AnalogInputs::ValueType p, int8_t dig)
{
    if(dig > 2) {
        lcdPrintUnsigned(p,dig-2);
        lcdPrint_P(PSTR("mV"));
    }
}
 void printBalancer(uint8_t cell, AnalogInputs::Type type) {
     if(AnalogInputs::isConnected(AnalogInputs::Name(AnalogInputs::Vb1+cell))) {
         lcdPrintAnalog(getBalanceValue(cell, type), 6, type);
     } else {
         lcdPrint_P(PSTR("  --  "));
     }
 }
Example #17
0
void SettingsMenu::printDeltaT(AnalogInputs::ValueType dt)
{
    lcdPrintUnsigned(dt/100, 3);
    lcdPrintChar('.');
    lcdPrintDigit((dt%100)/10);
    lcdPrint_P(PSTR("C/m"));
}
Example #18
0
void Screen::displayScreenTemperature()
{
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("Text="));
    if(settings.externT_ || settings.isDebug())
        analogInputs.printRealValue(AnalogInputs::Textern,    5);
    else
        lcdPrint_P(PSTR("-"));
    lcdPrintSpaces();

    lcdSetCursor0_1();
#ifdef ENABLE_T_INTERNAL
    lcdPrint_P(PSTR("Tint="));
    analogInputs.printRealValue(AnalogInputs::Tintern,    5);
#endif
    lcdPrintSpaces();
}
Example #19
0
void Screen::displayCalibrationErrorScreen(uint8_t errNo)
{
    lcdClear();
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("Cal.err.  F:"));
    lcdPrintUnsigned(errNo, 2);
    Time::delay(8000);
}
Example #20
0
uint8_t ProgramData::printChargeString() const
{
    if(battery.C == PROGRAM_DATA_MAX_CHARGE)
        lcdPrint_P(PSTR("unlimited"));
    else
        lcdPrintCharge(battery.C, 7);
    return 8;
}
Example #21
0
void Screen::displayDebugDelta()
{
    lcdSetCursor0_0();

    lcdPrint_P(PSTR("C="));
    lcdPrintUnsigned(analogInputs.getRealValue(AnalogInputs::deltaLastCount),5);
    lcdPrint_P(PSTR(" L="));
    int x = analogInputs.deltaLastT_;
    lcdPrintSigned(x, 6);
    lcdPrintSpaces();

    lcdSetCursor0_1();
    lcdPrint_P(PSTR("N="));
    lcdPrintUnsigned(analogInputs.deltaCount_,5);
    lcdPrint_P(PSTR(" L="));
    x = ProgramData::currentProgramData.getDeltaVLimit();
    lcdPrintSigned(x, 6);
    lcdPrintSpaces();
}
Example #22
0
void Screen::displayDebugI()
{
    AnalogInputs::Name Iset;
    AnalogInputs::Name Iget;
    if(smps.isPowerOn()) {
        Iset = AnalogInputs::IsmpsValue;
        Iget = AnalogInputs::Ismps;
    } else {
        Iset = AnalogInputs::IdischargeValue;
        Iget = AnalogInputs::Idischarge;
    }
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("Iset="));
    analogInputs.printRealValue(Iset, 7);
    lcdPrintSpaces();
    lcdSetCursor0_1();
    lcdPrint_P(PSTR("Iget="));
    analogInputs.printRealValue(Iget, 7);
    lcdPrintSpaces();
}
void ProgramDataMenu::createName()
{
    p_.createName(programIndex_+1);

    lcdClear();
    lcdSetCursor0_0();
    lcdPrint_P(PSTR("Name:"));
    lcdSetCursor0_1();
    lcdPrint(p_.name, PROGRAM_DATA_MAX_NAME);
    waitButtonPressed();
    Buzzer::soundSelect();
}
    void printBalancer(uint8_t cell, AnalogInputs::Type type) {
        if(cell < MAX_BALANCE_CELLS) {
            lcdPrintDigit(cell+1);
            lcdPrintChar(':');

            if(AnalogInputs::isConnected(AnalogInputs::Name(AnalogInputs::Vb1+cell))) {
                lcdPrintAnalog(getBalanceValue(cell, type), 6, type);
            } else {
                lcdPrint_P(PSTR("  --  "));
            }
        }
    }
Example #25
0
void Screen::displayStartInfo()
{
    lcdSetCursor0_0();
    ProgramData::currentProgramData.printBatteryString(4);
    lcdPrintChar(' ');
    ProgramData::currentProgramData.printVoltageString();
    lcdPrintChar(' ');
    printProgram2chars(Program::programType_);

    lcdSetCursor0_1();
    uint16_t procent = getChargeProcent();
    if(procent == 100) {
        if(getBlinkOff())
            lcdPrintSpaces(4);
        else
            lcdPrint_P(PSTR("FUL "));
    } else {
        lcdPrintUnsigned(procent, 2);
        lcdPrint_P(PSTR("% "));
    }

    int bindex = getBlinkIndex();
    if(bindex & 1) analogInputs.printRealValue(AnalogInputs::Vout, 5);
    else lcdPrintSpaces(5);

    lcdPrintChar(' ');
    if(ProgramData::currentProgramData.isLiXX()) {
        //display balance port
        if(bindex & 2) analogInputs.printRealValue(AnalogInputs::Vbalancer, 5);
        else lcdPrintSpaces(5);

        if(bindex & 4) lcdPrintDigit(analogInputs.getConnectedBalancePorts());
        else lcdPrintChar(' ');
    } else {

        lcdPrintCharge(ProgramData::currentProgramData.battery.C, 6);
        lcdPrintSpaces();
    }
}
Example #26
0
void Screen::displayScreenCIVlimits()
{
    lcdSetCursor0_0();
    lcdPrintCharge(ProgramData::currentProgramData.getCapacityLimit(), 8);
    lcdPrintChar(' ');
    lcdPrintCurrent(ProgramData::currentProgramData.battery.Ic, 7);
    lcdPrintSpaces();

    lcdSetCursor0_1();
    lcdPrint_P(PSTR("Limits: "));
    lcdPrintVoltage(ProgramData::currentProgramData.getVoltage(ProgramData::VCharge), 7);
    lcdPrintSpaces();
}
Example #27
0
void Screen::displayDebugRthVth()
{
    lcdSetCursor0_0();

    lcdPrint_P(PSTR("V="));
    //lcdPrintResistance(Rth_, 8);
    lcdPrintSigned(theveninMethod.tVout_.Rth_V_);
    lcdPrint_P(PSTR(" I="));
    //lcdPrintResistance(Rth_, 8);
    lcdPrintSigned(theveninMethod.tVout_.Rth_I_);
    lcdPrintSpaces();

    lcdSetCursor0_1();
    lcdPrintSigned(theveninMethod.tVout_.Vth_);
    lcdPrintChar(' ');
    lcdPrintSigned(theveninMethod.valueTh_, 4);
    lcdPrintChar(' ');
    uint16_t v;
    if(smps.isPowerOn())    v = smps.getValue();
    else                    v = discharger.getValue();
    lcdPrintSigned(v,4);
    lcdPrintSpaces();
}
void StaticEditMenu::printItem(uint8_t item)
{
    uint8_t index = getSelectedIndexOrSize(item);
    const char * str = pgm::read(&staticEditData[index].staticString);
    uint8_t dig = lcdPrint_P(str);
    if(getBlinkIndex() != item) {
        dig = LCD_COLUMNS - dig - 1;
        uint8_t size = pgm::read(&staticEditData[index].print.size);
        if(size) {
            lcdPrintSpaces(dig - size);
            dig = size;
        }
        cprintf::cprintf(&staticEditData[index].print, dig);
    }
}
Example #29
0
uint8_t ProgramData::printBatteryString(int n) const { return lcdPrint_P(pgm::read(&batteryString[battery.type]), n); }
 void printBatteryString() {
     lcdPrint_P(ProgramData::batteryString, ProgramData::battery.type);
 }