static state_t menuManualMode(button_t button) { if (button == BUTTON_ENTER) { lcdprint_P(PSTR("Manual fan mode"), true); editInt = pid.getManualOutputMode(); } else if (button == BUTTON_LEAVE) { // Check to see if it is different because the setPoint // field stores either the setPoint or manual mode boolean manual = (editInt != 0); if (manual != pid.getManualOutputMode()) storeSetPoint(manual ? 0 : pid.getSetPoint()); } menuBooleanEdit(button, NULL); return ST_AUTO; }
static state_t menuSetpoint(button_t button) { if (button == BUTTON_ENTER) { lcdprint_P(PSTR("Set temperature:"), true); editInt = pid.getSetPoint(); } else if (button == BUTTON_LEAVE) { // Check to see if it is different because the setPoint // field stores either the setPoint or manual mode if (editInt != pid.getSetPoint()) storeSetPoint(editInt); } menuNumberEdit(button, 5, 0, 1000, PSTR("%3d"DEGREE"%c")); return ST_AUTO; }
static void handleCommandUrl(char *URL) { unsigned char urlLen = strlen(URL); if (strncmp_P(URL, PSTR("set?sp="), 7) == 0) { storeSetPoint(atoi(URL + 7)); storePidUnits(URL[urlLen-1]); } else if (strncmp_P(URL, PSTR("set?lb="), 7) == 0) { csvParseI(URL + 7, storeLcdParam); reportLcdParameters(); } else if (strncmp_P(URL, PSTR("set?ld="), 7) == 0) { csvParseI(URL + 7, storeLidParam); reportLidParameters(); } else if (strncmp_P(URL, PSTR("set?po="), 7) == 0) { csvParseI(URL + 7, storeProbeOffset); reportProbeOffsets(); } else if (strncmp_P(URL, PSTR("set?pid"), 7) == 0 && urlLen > 9) { float f = atof(URL + 9); storePidParam(URL[7], f); reportPidParams(); } else if (strncmp_P(URL, PSTR("set?pn"), 6) == 0 && urlLen > 8) { // Store probe name will only store it if a valid probe number is passed storeAndReportProbeName(URL[6] - '0', URL + 8); } else if (strncmp_P(URL, PSTR("set?pc"), 6) == 0 && urlLen > 8) { storeProbeCoeff(URL[6] - '0', URL + 8); } else if (strncmp_P(URL, PSTR("set?al="), 7) == 0) { csvParseI(URL + 7, storeAlarmLimits); reportAlarmLimits(); } else if (strncmp_P(URL, PSTR("set?fn="), 7) == 0) { csvParseI(URL + 7, storeFanParams); reportFanParams(); } else if (strncmp_P(URL, PSTR("set?tt="), 7) == 0) { Menus.displayToast(URL+7); } else if (strncmp_P(URL, PSTR("set?tp="), 7) == 0) { csvParseI(URL + 7, setTempParam); } else if (strncmp_P(URL, PSTR("config"), 6) == 0) { reportConfig(); } else if (strncmp_P(URL, PSTR("reboot"), 5) == 0) { reboot(); // reboot doesn't return } }