Пример #1
0
void set_region(void) {
  uint8_t mode = init_set_menu(4);

  while (!check_timeout()) {
    
  
    if (just_pressed & 0x2) {
      just_pressed = 0;
      screenmutex++;

      if (mode == SET_REGION) {
	DEBUG(putstring("Setting region"));
	// ok now its selected
	mode = SET_REG;
	// print the region 
	print_region_setting(INVERTED);
	// display instructions below
	print_menu_change();
      } else {
	mode = SET_REGION;
	// print the region normal
	print_region_setting(NORMAL);
#ifdef BACKLIGHT_ADJUST
        print_menu_advance();
#else
	print_menu_exit();
#endif
      }
      screenmutex--;
    }
    if ((just_pressed & 0x4) || (pressed & 0x4)) {
      just_pressed = 0;
      
      if (mode == SET_REG) {
	    if(time_format) {        
	      region++;
#ifdef OPTION_DOW_DATELONG
	      if(region > DATELONG_DOW)
#else
          if(region > REGION_EU)
#endif
	        region = 0;
		}
		time_format = !time_format;
	screenmutex++;
	display_menu(4);
	print_menu_change();

	print_region_setting(INVERTED);
	screenmutex--;

	eeprom_write_byte(&EE_REGION, region);
	eeprom_write_byte(&EE_TIME_FORMAT, time_format);    
      }
    }
  }
}
Пример #2
0
void display_menu(uint8_t line) {
  DEBUGP("display menu");
  
  screenmutex++;

  glcdClearScreen();
  
  //Dataman - Mode Menu Option
  //glcdSetAddress(0, 0);
  //glcdPutStr("Configuration Menu", NORMAL);
  glcdSetAddress(MENU_INDENT, 0);
  glcdPutStr("Mode:", NORMAL);
  print_style_setting(NORMAL);
 
  print_alarmline(SET_ALARM);
  
  print_time(time_h,time_m,time_s,SET_TIME);
  print_date(date_m,date_d,date_y,SET_DATE);
  print_region_setting(NORMAL);
  
#ifdef BACKLIGHT_ADJUST
  print_backlight(SET_BRIGHTNESS);

  if(displaymode == SET_BRIGHTNESS)
#else
  if(displaymode == SET_REGION)
#endif
  	  print_menu_exit();
  else
  	print_menu_advance();

  drawArrow(0, (line*8)+3, MENU_INDENT -1);
  screenmutex--;
}
Пример #3
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--;
}