Example #1
0
static state_t menuLidOpenDur(button_t button)
{
    if (button == BUTTON_ENTER)
    {
        lcdprint_P(PSTR("Lid open timer"), true);
        editInt = pid.getLidOpenDuration();
    }
    else if (button == BUTTON_LEAVE)
    {
        storeLidParam(LIDPARAM_DURATION, editInt);
    }

    menuNumberEdit(button, 10, 0, 1000, PSTR("%3d seconds"));
    return ST_AUTO;
}
Example #2
0
static state_t menuLidOpenOff(button_t button)
{
    if (button == BUTTON_ENTER)
    {
        lcdprint_P(PSTR("Lid open offset"), true);
        editInt = pid.LidOpenOffset;
    }
    else if (button == BUTTON_LEAVE)
    {
        storeLidParam(LIDPARAM_OFFSET, editInt);
    }

    menuNumberEdit(button, 1, 0, 100, PSTR("%3d%% below set"));
    return ST_AUTO;
}
Example #3
0
static state_t menuMaxFanSpeed(button_t button)
{
  if (button == BUTTON_ENTER)
  {
    lcdprint_P(PSTR("Maximum auto fan"), true);
    editInt = pid.getFanMaxSpeed();
  }
  else if (button == BUTTON_LEAVE)
  {
    if (editInt != pid.getFanMaxSpeed())
      storeAndReportMaxFanSpeed(editInt);
  }
  
  menuNumberEdit(button, 5, 0, 100, PSTR("speed %3d%%"));
  return ST_AUTO;
}
Example #4
0
static state_t menuResetConfig(button_t button)
{
  if (button == BUTTON_ENTER)
  {
    lcdprint_P(PSTR("Reset config?"), true);
    editInt = 0;
  }
  else if (button == BUTTON_LEAVE)
  {
    if (editInt != 0)
    {
      eepromLoadConfig(1);
      print_P(PSTR("HMRC,USER")); Serial_nl();
    }
  }
  menuBooleanEdit(button, NULL);
  return ST_AUTO;
}
Example #5
0
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;
}
Example #6
0
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;
}
Example #7
0
static state_t menuLcdBacklight(button_t button)
{
  if (button == BUTTON_ENTER)
  {
    lcdprint_P(PSTR("LCD brightness"), true);
    editInt = g_LcdBacklight;
  }
  else if (button == BUTTON_LEAVE)
  {
    if (editInt != g_LcdBacklight)
    {
      storeLcdBacklight(editInt);
      reportLcdParameters();
    }
  }
  
  menuNumberEdit(button, 10, 0, 100, PSTR("%3d%%"));
  setLcdBacklight(0x80 | editInt);
  return ST_AUTO;
}
Example #8
0
void updateDisplay(void)
{
  // Updates to the temperature can come at any time, only update 
  // if we're in a state that displays them
  state_t state = Menus.getState();
  if (!isMenuHomeState())
    return;

  char buffer[17];
  unsigned char probeIdxLow, probeIdxHigh;

  // Fixed pit area
  lcd.setCursor(0, 0);
  if (state == ST_HOME_ALARM)
  {
    toneEnable(true);
    if (ALARM_ID_TO_IDX(g_AlarmId) == ALARM_IDX_LOW)
      lcdprint_P(PSTR("** ALARM LOW  **"), false);
    else
      lcdprint_P(PSTR("** ALARM HIGH **"), false);

    probeIdxLow = probeIdxHigh = ALARM_ID_TO_PROBE(g_AlarmId);
  }  /* if ST_HOME_ALARM */
  else
  {
    toneEnable(false);

    /* Big Number probes overwrite the whole display if it has a temperature */
    if (g_HomeDisplayMode >= TEMP_PIT && g_HomeDisplayMode <= TEMP_AMB)
    {
      TempProbe *probe = pid.Probes[g_HomeDisplayMode];
      if (probe->hasTemperature())
      {
        lcdPrintBigNum(probe->Temperature);
        return;
      }
    }

    /* Default Pit / Fan Speed first line */
    int pitTemp;
    if (pid.Probes[TEMP_CTRL]->hasTemperature())
      pitTemp = pid.Probes[TEMP_CTRL]->Temperature;
    else
      pitTemp = 0;
    if (!pid.getManualOutputMode() && !pid.Probes[TEMP_CTRL]->hasTemperature())
      memcpy_P(buffer, LCD_LINE1_UNPLUGGED, sizeof(LCD_LINE1_UNPLUGGED));
    else if (pid.LidOpenResumeCountdown > 0)
      snprintf_P(buffer, sizeof(buffer), PSTR("Pit:%3d"DEGREE"%c Lid%3u"),
        pitTemp, pid.getUnits(), pid.LidOpenResumeCountdown);
    else
    {
      char c1,c2;
      if (pid.getManualOutputMode())
      {
        c1 = '^';  // LCD_ARROWUP
        c2 = '^';  // LCD_ARROWDN
      }
      else
      {
        c1 = '[';
        c2 = ']';
      }
      snprintf_P(buffer, sizeof(buffer), PSTR("Pit:%3d"DEGREE"%c %c%3u%%%c"),
        pitTemp, pid.getUnits(), c1, pid.getPidOutput(), c2);
    }

    lcd.print(buffer);
    // Display mode 0xff is 2-line, which only has space for 1 non-pit value
    if (g_HomeDisplayMode == 0xff)
      probeIdxLow = probeIdxHigh = state - ST_HOME_FOOD1 + TEMP_FOOD1;
    else
    {
      // Display mode 0xfe is 4 line home, display 3 other temps there
      probeIdxLow = TEMP_FOOD1;
      probeIdxHigh = TEMP_AMB;
    }
  } /* if !ST_HOME_ALARM */

  // Rotating probe display
  for (unsigned char probeIndex=probeIdxLow; probeIndex<=probeIdxHigh; ++probeIndex)
  {
    if (probeIndex < TEMP_COUNT && pid.Probes[probeIndex]->hasTemperature())
    {
      loadProbeName(probeIndex);
      snprintf_P(buffer, sizeof(buffer), PSTR("%-12s%3d"DEGREE), editString,
        (int)pid.Probes[probeIndex]->Temperature);
    }
    else
    {
      // If probeIndex is outside the range (in the case of ST_HOME_NOPROBES)
      // just fill the bottom line with spaces
      memset(buffer, ' ', sizeof(buffer));
      buffer[sizeof(buffer) - 1] = '\0';
    }

    lcd.setCursor(0, probeIndex - probeIdxLow + 1);
    lcd.print(buffer);
  }
}