void run() { StaticMenu menu(calibrateMenu); int8_t i; do { i = menu.runSimple(); if(i<0) break; //TODO: rewrite ProgramData::battery.enable_externT = 0; SerialLog::powerOn(); START_CASE_COUNTER; switch(i) { case NEXT_CASE: calibrateVoltage(); break; case NEXT_CASE: calibrateI(chargeIMenu, chargeIValues); break; case NEXT_CASE: calibrateI(dischargeIMenu, dischargeIValues); break; case NEXT_CASE: calibrateExternT(); break; #ifdef ENABLE_T_INTERNAL case NEXT_CASE: calibrateInternT(); break; #endif #ifdef ENABLE_EXPERT_VOLTAGE_CALIBRATION case NEXT_CASE: expertCalibrateVoltage(); break; #endif } SerialLog::powerOff(); } while(true); Program::programState = Program::Done; }
void run() { // Program::programState_ = Program::Calibration; StaticMenu menu(calibrateMenu); int8_t i; do { i = menu.runSimple(); if(i<0) break; SerialLog::powerOn(); AnalogInputs::powerOn(); START_CASE_COUNTER; switch(i) { case NEXT_CASE: calibrateVoltage(); break; case NEXT_CASE: calibrateI(chargeIMenu, chargeIValues); break; case NEXT_CASE: calibrateI(dischargeIMenu, dischargeIValues); break; case NEXT_CASE: calibrateTemp(AnalogInputs::Textern); break; #ifdef ENABLE_T_INTERNAL case NEXT_CASE: calibrateTemp(AnalogInputs::Tintern); break; #endif #ifdef ENABLE_EXPERT_VOLTAGE_CALIBRATION case NEXT_CASE: expertCalibrateVoltage(); break; #endif } eeprom::restoreCalibrationCRC(); AnalogInputs::powerOff(); SerialLog::powerOff(); } while(true); Program::programState_ = Program::Done; }