void SettingsMenu::printViewType() const { if(p_.view_ == Screen::Normal) lcdPrint_P(PSTR("normal")); else lcdPrint_P(PSTR("debug")); }
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(); }
void lcdPrintYesNo(uint8_t yes) { if(yes) lcdPrint_P(PSTR("yes")); else lcdPrint_P(PSTR(" no")); }
void screenEnd(const char * firstLine) { lcdSetCursor0_0(); lcdPrint_P(firstLine); lcdPrintTime(Monitor::getTimeSec()); lcdSetCursor0_1(); lcdPrint_P(Program::stopReason); lcdPrintSpaces(); }
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); }
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); }
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(); }
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(); }
void Screen::displayDeltaVout() { lcdSetCursor0_0(); lcdPrint_P(PSTR("maxVout=")); analogInputs.printRealValue(AnalogInputs::deltaVoutMax, 7); lcdPrintSpaces(); lcdSetCursor0_1(); lcdPrint_P(PSTR("delta V= ")); deltaV(); }
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); } }
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(); }
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(); }
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(); }
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(); }
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(" -- ")); } }
void SettingsMenu::printDeltaT(AnalogInputs::ValueType dt) { lcdPrintUnsigned(dt/100, 3); lcdPrintChar('.'); lcdPrintDigit((dt%100)/10); lcdPrint_P(PSTR("C/m")); }
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(); }
void Screen::displayCalibrationErrorScreen(uint8_t errNo) { lcdClear(); lcdSetCursor0_0(); lcdPrint_P(PSTR("Cal.err. F:")); lcdPrintUnsigned(errNo, 2); Time::delay(8000); }
uint8_t ProgramData::printChargeString() const { if(battery.C == PROGRAM_DATA_MAX_CHARGE) lcdPrint_P(PSTR("unlimited")); else lcdPrintCharge(battery.C, 7); return 8; }
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(); }
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(" -- ")); } } }
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(); } }
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(); }
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); } }
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); }