Exemplo n.º 1
0
void display_menu(void) {
  DEBUGP("display menu");
  
  screenmutex++;

  displayClearScreen();
  
  displaySetAddress(0, 0);
  displayPutStr("Configuration Menu", NORMAL);
  
  displaySetAddress(MENU_INDENT, 1);
  displayPutStr("Set Alarm:  ", NORMAL);
  print_alarmhour(alarm_h, NORMAL);
  displayWriteChar(':', NORMAL);
  printnumber(alarm_m, NORMAL);
  
  displaySetAddress(MENU_INDENT, 2);
  displayPutStr("Set Time: ", NORMAL);
  print_timehour(time_h, NORMAL);
  displayWriteChar(':', NORMAL);
  printnumber(time_m, NORMAL);
  displayWriteChar(':', NORMAL);
  printnumber(time_s, NORMAL);
  if (time_format == TIME_12H) {
    displayWriteChar(' ', NORMAL);
    if (time_h >= 12) {
      displayWriteChar('P', NORMAL);
    } else {
      displayWriteChar('A', NORMAL);
    }
  }
  
  print_date(date_m,date_d,date_y,SET_DATE);
  print_region_setting(NORMAL);
  
#ifdef BACKLIGHT_ADJUST
  displaySetAddress(MENU_INDENT, 5);
  displayPutStr("Set Backlight: ", NORMAL);
  printnumber(OCR2B>>OCR2B_BITSHIFT,NORMAL);
#endif
  
  displaySetAddress(0, 6);
  displayPutStr("Press MENU to advance", NORMAL);
  displaySetAddress(0, 7);
  displayPutStr("Press SET to set", NORMAL);

  screenmutex--;
}
Exemplo n.º 2
0
void print_time(uint8_t hour, uint8_t min, uint8_t sec, uint8_t mode)
{
  glcdSetAddress(MENU_INDENT, 2);
  glcdPutStr("Set Time: ", NORMAL);
  print_timehour(hour, ((mode==SET_HOUR)?INVERTED:NORMAL));
  glcdWriteChar(':', NORMAL);
  printnumber(min, ((mode==SET_MIN)?INVERTED:NORMAL));
  glcdWriteChar(':', NORMAL);
  printnumber(sec, ((mode==SET_SEC)?INVERTED:NORMAL));
  if (time_format == TIME_12H) {
    glcdWriteChar(' ', NORMAL);
    if (hour >= 12) {
      glcdWriteChar('P', ((mode==SET_HOUR)?INVERTED:NORMAL));
    } else {
      glcdWriteChar('A', ((mode==SET_HOUR)?INVERTED:NORMAL));
    }
  }
}