static void lcd_return_to_status() { lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) currentMenu == lcd_status_screen #endif ); lcd_goto_menu(lcd_status_screen, 0, false); }
static void _lcd_babystep(int axis, const char *msg) { if (encoderPosition != 0) { babystepsTodo[axis] += (int)encoderPosition; encoderPosition = 0; lcdDrawUpdate = 1; } if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(msg), ""); if (LCD_CLICKED) lcd_goto_menu(lcd_tune_menu); }
static void _lcd_babystep(int axis, const char *msg) { if (encoderPosition != 0) { babystepsTodo[axis] += (int)encoderPosition; babystepMem[axis] += (int)encoderPosition; encoderPosition = 0; lcdDrawUpdate = 1; } if (lcdDrawUpdate) lcd_implementation_drawedit_2(msg, ftostr51(babystepMem[axis])); if (LCD_CLICKED) lcd_goto_menu(lcd_tune_menu); EEPROM_save_B(4093,&babystepMem[0]); EEPROM_save_B(4091,&babystepMem[1]); EEPROM_save_B(4089,&babystepMem[2]); }
static void lcd_set_contrast() { if (encoderPosition != 0) { lcd_contrast -= encoderPosition; if (lcd_contrast < 0) lcd_contrast = 0; else if (lcd_contrast > 63) lcd_contrast = 63; encoderPosition = 0; lcdDrawUpdate = 1; u8g.setContrast(lcd_contrast); } if (lcdDrawUpdate) { lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast)); } if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu); }
static void _lcd_move(const char *name, int axis, int min, int max) { if (encoderPosition != 0) { refresh_cmd_timeout(); current_position[axis] += float((int)encoderPosition) * move_menu_scale; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; if (max_software_endstops && current_position[axis] > max) current_position[axis] = max; encoderPosition = 0; #ifdef DELTA calculate_delta(current_position); plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); #else plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder); #endif lcdDrawUpdate = 1; } if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis])); if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis); }
static void lcd_move_e() { if (encoderPosition != 0) { current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale; encoderPosition = 0; #ifdef DELTA calculate_delta(current_position); plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder); #else plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder); #endif lcdDrawUpdate = 1; } if (lcdDrawUpdate) { lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS])); } if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis); }
static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen, 0, false); }
/* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */ static void lcd_status_screen() { if (lcd_status_update_delay) lcd_status_update_delay--; else lcdDrawUpdate = 1; if (lcdDrawUpdate) { lcd_implementation_status_screen(); lcd_status_update_delay = 10; /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */ } #ifdef ULTIPANEL bool current_click = LCD_CLICKED; if (ignore_click) { if (wait_for_unclick) { if (!current_click) { ignore_click = wait_for_unclick = false; } else { current_click = false; } } else if (current_click) { lcd_quick_feedback(); wait_for_unclick = true; current_click = false; } } if (current_click) { lcd_goto_menu(lcd_main_menu); lcd_implementation_init(); // to maybe revive the LCD if static electricity killed it. #ifdef FILAMENT_LCD_DISPLAY message_millis=millis(); //get status message to show up for a while #endif } #ifdef ULTIPANEL_FEEDMULTIPLY // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100) || (feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100)) { encoderPosition = 0; feedmultiply = 100; } if (feedmultiply == 100 && int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) { feedmultiply += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE; encoderPosition = 0; } else if (feedmultiply == 100 && int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) { feedmultiply += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE; encoderPosition = 0; } else if (feedmultiply != 100) { feedmultiply += int(encoderPosition); encoderPosition = 0; } #endif//ULTIPANEL_FEEDMULTIPLY if (feedmultiply < 10) feedmultiply = 10; else if (feedmultiply > 999) feedmultiply = 999; #endif//ULTIPANEL }
static void menu_action_submenu(menuFunc_t data) { lcd_goto_menu(data); }
static void lcd_silent_mode_set(){ SilentModeMenu = !SilentModeMenu; EEPROM_save(4095,(uint8_t*)&SilentModeMenu,sizeof(SilentModeMenu)); digipot_init(); lcd_goto_menu(lcd_settings_menu, 7); }
/* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */ static void lcd_status_screen() { #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD) uint16_t mil = millis(); #ifndef PROGRESS_MSG_ONCE if (mil > progressBarTick + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) { progressBarTick = mil; } #endif #if PROGRESS_MSG_EXPIRE > 0 // keep the message alive if paused, count down otherwise if (messageTick > 0) { if (card.isFileOpen()) { if (IS_SD_PRINTING) { if ((mil-messageTick) >= PROGRESS_MSG_EXPIRE) { lcd_status_message[0] = '\0'; messageTick = 0; } } else { messageTick += LCD_UPDATE_INTERVAL; } } else { messageTick = 0; } } #endif #endif //LCD_PROGRESS_BAR if (lcd_status_update_delay) lcd_status_update_delay--; else lcdDrawUpdate = 1; if (lcdDrawUpdate) { lcd_implementation_status_screen(); lcd_status_update_delay = 10; /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */ } #ifdef ULTIPANEL bool current_click = LCD_CLICKED; if (ignore_click) { if (wait_for_unclick) { if (!current_click) { ignore_click = wait_for_unclick = false; } else { current_click = false; } } else if (current_click) { lcd_quick_feedback(); wait_for_unclick = true; current_click = false; } } if (current_click) { lcd_goto_menu(lcd_main_menu); lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD) currentMenu == lcd_status_screen #endif ); #ifdef FILAMENT_LCD_DISPLAY message_millis = millis(); // get status message to show up for a while #endif } #ifdef ULTIPANEL_FEEDMULTIPLY // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100) || (feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100)) { encoderPosition = 0; feedmultiply = 100; } if (feedmultiply == 100 && int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) { feedmultiply += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE; encoderPosition = 0; } else if (feedmultiply == 100 && int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) { feedmultiply += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE; encoderPosition = 0; } else if (feedmultiply != 100) { feedmultiply += int(encoderPosition); encoderPosition = 0; } #endif //ULTIPANEL_FEEDMULTIPLY if (feedmultiply < 10) feedmultiply = 10; else if (feedmultiply > 999) feedmultiply = 999; #endif //ULTIPANEL }