|
|
@ -1,5 +1,5 @@ |
|
|
|
#include "ultralcd.h" |
|
|
|
#ifdef ULTRA_LCD |
|
|
|
#if ENABLED(ULTRA_LCD) |
|
|
|
#include "Marlin.h" |
|
|
|
#include "language.h" |
|
|
|
#include "cardreader.h" |
|
|
@ -20,7 +20,7 @@ int absPreheatHotendTemp; |
|
|
|
int absPreheatHPBTemp; |
|
|
|
int absPreheatFanSpeed; |
|
|
|
|
|
|
|
#ifdef FILAMENT_LCD_DISPLAY |
|
|
|
#if ENABLED(FILAMENT_LCD_DISPLAY) |
|
|
|
millis_t previous_lcd_status_ms = 0; |
|
|
|
#endif |
|
|
|
|
|
|
@ -30,7 +30,7 @@ typedef void (*menuFunc_t)(); |
|
|
|
uint8_t lcd_status_message_level; |
|
|
|
char lcd_status_message[3*LCD_WIDTH+1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
|
|
|
|
|
|
|
|
#ifdef DOGLCD |
|
|
|
#if ENABLED(DOGLCD) |
|
|
|
#include "dogm_lcd_implementation.h" |
|
|
|
#else |
|
|
|
#include "ultralcd_implementation_hitachi_HD44780.h" |
|
|
@ -39,7 +39,7 @@ char lcd_status_message[3*LCD_WIDTH+1] = WELCOME_MSG; // worst case is kana with |
|
|
|
// The main status screen
|
|
|
|
static void lcd_status_screen(); |
|
|
|
|
|
|
|
#ifdef ULTIPANEL |
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
|
|
|
|
#if HAS_POWER_SWITCH |
|
|
|
extern bool powersupply; |
|
|
@ -55,19 +55,19 @@ static void lcd_status_screen(); |
|
|
|
static void lcd_control_temperature_preheat_abs_settings_menu(); |
|
|
|
static void lcd_control_motion_menu(); |
|
|
|
static void lcd_control_volumetric_menu(); |
|
|
|
#ifdef HAS_LCD_CONTRAST |
|
|
|
#if ENABLED(HAS_LCD_CONTRAST) |
|
|
|
static void lcd_set_contrast(); |
|
|
|
#endif |
|
|
|
#ifdef FWRETRACT |
|
|
|
#if ENABLED(FWRETRACT) |
|
|
|
static void lcd_control_retract_menu(); |
|
|
|
#endif |
|
|
|
static void lcd_sdcard_menu(); |
|
|
|
|
|
|
|
#ifdef DELTA_CALIBRATION_MENU |
|
|
|
#if ENABLED(DELTA_CALIBRATION_MENU) |
|
|
|
static void lcd_delta_calibrate_menu(); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if defined(MANUAL_BED_LEVELING) |
|
|
|
#if ENABLED(MANUAL_BED_LEVELING) |
|
|
|
#include "mesh_bed_leveling.h" |
|
|
|
static void _lcd_level_bed(); |
|
|
|
static void _lcd_level_bed_homing(); |
|
|
@ -102,7 +102,7 @@ static void lcd_status_screen(); |
|
|
|
|
|
|
|
#define ENCODER_FEEDRATE_DEADZONE 10 |
|
|
|
|
|
|
|
#if !defined(LCD_I2C_VIKI) |
|
|
|
#if DISABLED(LCD_I2C_VIKI) |
|
|
|
#ifndef ENCODER_STEPS_PER_MENU_ITEM |
|
|
|
#define ENCODER_STEPS_PER_MENU_ITEM 5 |
|
|
|
#endif |
|
|
@ -169,7 +169,7 @@ static void lcd_status_screen(); |
|
|
|
_menuItemNr++; \ |
|
|
|
} while(0) |
|
|
|
|
|
|
|
#ifdef ENCODER_RATE_MULTIPLIER |
|
|
|
#if ENABLED(ENCODER_RATE_MULTIPLIER) |
|
|
|
|
|
|
|
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
|
|
|
|
|
|
|
@ -196,7 +196,7 @@ static void lcd_status_screen(); |
|
|
|
#define MENU_ITEM_DUMMY() do { _menuItemNr++; } while(0) |
|
|
|
#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) |
|
|
|
#define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) |
|
|
|
#ifdef ENCODER_RATE_MULTIPLIER |
|
|
|
#if ENABLED(ENCODER_RATE_MULTIPLIER) |
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) |
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) |
|
|
|
#else //!ENCODER_RATE_MULTIPLIER
|
|
|
@ -210,11 +210,11 @@ static void lcd_status_screen(); |
|
|
|
|
|
|
|
/** Used variables to keep track of the menu */ |
|
|
|
volatile uint8_t buttons; //the last checked buttons in a bit array.
|
|
|
|
#ifdef REPRAPWORLD_KEYPAD |
|
|
|
#if ENABLED(REPRAPWORLD_KEYPAD) |
|
|
|
volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef LCD_HAS_SLOW_BUTTONS |
|
|
|
#if ENABLED(LCD_HAS_SLOW_BUTTONS) |
|
|
|
volatile uint8_t slow_buttons; // Bits of the pressed buttons.
|
|
|
|
#endif |
|
|
|
uint8_t currentMenuViewOffset; /* scroll offset in the current menu */ |
|
|
@ -252,12 +252,12 @@ float raw_Ki, raw_Kd; |
|
|
|
static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint32_t encoder=0) { |
|
|
|
if (currentMenu != menu) { |
|
|
|
currentMenu = menu; |
|
|
|
#ifdef NEWPANEL |
|
|
|
#if ENABLED(NEWPANEL) |
|
|
|
encoderPosition = encoder; |
|
|
|
if (feedback) lcd_quick_feedback(); |
|
|
|
#endif |
|
|
|
// For LCD_PROGRESS_BAR re-initialize the custom characters
|
|
|
|
#ifdef LCD_PROGRESS_BAR |
|
|
|
#if ENABLED(LCD_PROGRESS_BAR) |
|
|
|
lcd_set_custom_characters(menu == lcd_status_screen); |
|
|
|
#endif |
|
|
|
} |
|
|
@ -273,7 +273,7 @@ static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint |
|
|
|
static void lcd_status_screen() { |
|
|
|
encoderRateMultiplierEnabled = false; |
|
|
|
|
|
|
|
#ifdef LCD_PROGRESS_BAR |
|
|
|
#if ENABLED(LCD_PROGRESS_BAR) |
|
|
|
millis_t ms = millis(); |
|
|
|
#ifndef PROGRESS_MSG_ONCE |
|
|
|
if (ms > progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) { |
|
|
@ -305,7 +305,7 @@ static void lcd_status_screen() { |
|
|
|
|
|
|
|
lcd_implementation_status_screen(); |
|
|
|
|
|
|
|
#ifdef ULTIPANEL |
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
|
|
|
|
bool current_click = LCD_CLICKED; |
|
|
|
|
|
|
@ -326,16 +326,16 @@ static void lcd_status_screen() { |
|
|
|
if (current_click) { |
|
|
|
lcd_goto_menu(lcd_main_menu, true); |
|
|
|
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
|
|
|
|
#ifdef LCD_PROGRESS_BAR |
|
|
|
#if ENABLED(LCD_PROGRESS_BAR) |
|
|
|
currentMenu == lcd_status_screen |
|
|
|
#endif |
|
|
|
); |
|
|
|
#ifdef FILAMENT_LCD_DISPLAY |
|
|
|
#if ENABLED(FILAMENT_LCD_DISPLAY) |
|
|
|
previous_lcd_status_ms = millis(); // get status message to show up for a while
|
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef ULTIPANEL_FEEDMULTIPLY |
|
|
|
#if ENABLED(ULTIPANEL_FEEDMULTIPLY) |
|
|
|
// Dead zone at 100% feedrate
|
|
|
|
if ((feedrate_multiplier < 100 && (feedrate_multiplier + int(encoderPosition)) > 100) || |
|
|
|
(feedrate_multiplier > 100 && (feedrate_multiplier + int(encoderPosition)) < 100)) { |
|
|
@ -363,7 +363,7 @@ static void lcd_status_screen() { |
|
|
|
#endif //ULTIPANEL
|
|
|
|
} |
|
|
|
|
|
|
|
#ifdef ULTIPANEL |
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
|
|
|
|
static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); } |
|
|
|
|
|
|
@ -394,13 +394,13 @@ static void lcd_main_menu() { |
|
|
|
} |
|
|
|
else { |
|
|
|
MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); |
|
|
|
#ifdef DELTA_CALIBRATION_MENU |
|
|
|
#if ENABLED(DELTA_CALIBRATION_MENU) |
|
|
|
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); |
|
|
|
#endif |
|
|
|
} |
|
|
|
MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); |
|
|
|
|
|
|
|
#ifdef SDSUPPORT |
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
if (card.cardOK) { |
|
|
|
if (card.isFileOpen()) { |
|
|
|
if (card.sdprinting) |
|
|
@ -427,7 +427,7 @@ static void lcd_main_menu() { |
|
|
|
END_MENU(); |
|
|
|
} |
|
|
|
|
|
|
|
#if defined(SDSUPPORT) && defined(MENU_ADDAUTOSTART) |
|
|
|
#if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) |
|
|
|
static void lcd_autostart_sd() { |
|
|
|
card.autostart_index = 0; |
|
|
|
card.setroot(); |
|
|
@ -445,7 +445,7 @@ void lcd_set_home_offsets() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef BABYSTEPPING |
|
|
|
#if ENABLED(BABYSTEPPING) |
|
|
|
|
|
|
|
static void _lcd_babystep(int axis, const char *msg) { |
|
|
|
if (encoderPosition != 0) { |
|
|
@ -500,14 +500,14 @@ static void lcd_tune_menu() { |
|
|
|
MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N3, &extruder_multiplier[3], 10, 999); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef BABYSTEPPING |
|
|
|
#ifdef BABYSTEP_XY |
|
|
|
#if ENABLED(BABYSTEPPING) |
|
|
|
#if ENABLED(BABYSTEP_XY) |
|
|
|
MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x); |
|
|
|
MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y); |
|
|
|
#endif //BABYSTEP_XY
|
|
|
|
MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z); |
|
|
|
#endif |
|
|
|
#ifdef FILAMENTCHANGEENABLE |
|
|
|
#if ENABLED(FILAMENTCHANGEENABLE) |
|
|
|
MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600")); |
|
|
|
#endif |
|
|
|
END_MENU(); |
|
|
@ -638,10 +638,10 @@ static void lcd_prepare_menu() { |
|
|
|
//
|
|
|
|
// Level Bed
|
|
|
|
//
|
|
|
|
#ifdef ENABLE_AUTO_BED_LEVELING |
|
|
|
#if ENABLED(ENABLE_AUTO_BED_LEVELING) |
|
|
|
if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) |
|
|
|
MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G29")); |
|
|
|
#elif defined(MANUAL_BED_LEVELING) |
|
|
|
#elif ENABLED(MANUAL_BED_LEVELING) |
|
|
|
MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed); |
|
|
|
#endif |
|
|
|
|
|
|
@ -687,14 +687,14 @@ static void lcd_prepare_menu() { |
|
|
|
//
|
|
|
|
// Autostart
|
|
|
|
//
|
|
|
|
#if defined(SDSUPPORT) && defined(MENU_ADDAUTOSTART) |
|
|
|
#if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) |
|
|
|
MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); |
|
|
|
#endif |
|
|
|
|
|
|
|
END_MENU(); |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef DELTA_CALIBRATION_MENU |
|
|
|
#if ENABLED(DELTA_CALIBRATION_MENU) |
|
|
|
|
|
|
|
static void lcd_delta_calibrate_menu() { |
|
|
|
START_MENU(); |
|
|
@ -710,7 +710,7 @@ static void lcd_prepare_menu() { |
|
|
|
#endif // DELTA_CALIBRATION_MENU
|
|
|
|
|
|
|
|
inline void line_to_current(AxisEnum axis) { |
|
|
|
#ifdef DELTA |
|
|
|
#if ENABLED(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 |
|
|
@ -814,14 +814,14 @@ static void lcd_control_menu() { |
|
|
|
MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); |
|
|
|
MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu); |
|
|
|
|
|
|
|
#ifdef HAS_LCD_CONTRAST |
|
|
|
#if ENABLED(HAS_LCD_CONTRAST) |
|
|
|
//MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
|
|
|
|
MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); |
|
|
|
#endif |
|
|
|
#ifdef FWRETRACT |
|
|
|
#if ENABLED(FWRETRACT) |
|
|
|
MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu); |
|
|
|
#endif |
|
|
|
#ifdef EEPROM_SETTINGS |
|
|
|
#if ENABLED(EEPROM_SETTINGS) |
|
|
|
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); |
|
|
|
MENU_ITEM(function, MSG_LOAD_EPROM, Config_RetrieveSettings); |
|
|
|
#endif |
|
|
@ -835,7 +835,7 @@ static void lcd_control_menu() { |
|
|
|
* |
|
|
|
*/ |
|
|
|
|
|
|
|
#ifdef PIDTEMP |
|
|
|
#if ENABLED(PIDTEMP) |
|
|
|
|
|
|
|
// Helpers for editing PID Ki & Kd values
|
|
|
|
// grab the PID value out of the temp variable; scale it; then update the PID driver
|
|
|
@ -849,7 +849,7 @@ static void lcd_control_menu() { |
|
|
|
} |
|
|
|
void copy_and_scalePID_i_E1() { copy_and_scalePID_i(0); } |
|
|
|
void copy_and_scalePID_d_E1() { copy_and_scalePID_d(0); } |
|
|
|
#ifdef PID_PARAMS_PER_EXTRUDER |
|
|
|
#if ENABLED(PID_PARAMS_PER_EXTRUDER) |
|
|
|
#if EXTRUDERS > 1 |
|
|
|
void copy_and_scalePID_i_E2() { copy_and_scalePID_i(1); } |
|
|
|
void copy_and_scalePID_d_E2() { copy_and_scalePID_d(1); } |
|
|
@ -916,7 +916,7 @@ static void lcd_control_temperature_menu() { |
|
|
|
//
|
|
|
|
// Autotemp, Min, Max, Fact
|
|
|
|
//
|
|
|
|
#if defined(AUTOTEMP) && (TEMP_SENSOR_0 != 0) |
|
|
|
#if ENABLED(AUTOTEMP) && (TEMP_SENSOR_0 != 0) |
|
|
|
MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled); |
|
|
|
MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15); |
|
|
|
MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15); |
|
|
@ -926,7 +926,7 @@ static void lcd_control_temperature_menu() { |
|
|
|
//
|
|
|
|
// PID-P, PID-I, PID-D, PID-C
|
|
|
|
//
|
|
|
|
#ifdef PIDTEMP |
|
|
|
#if ENABLED(PIDTEMP) |
|
|
|
// set up temp variables - undo the default scaling
|
|
|
|
raw_Ki = unscalePID_i(PID_PARAM(Ki,0)); |
|
|
|
raw_Kd = unscalePID_d(PID_PARAM(Kd,0)); |
|
|
@ -934,10 +934,10 @@ static void lcd_control_temperature_menu() { |
|
|
|
// i is typically a small value so allows values below 1
|
|
|
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E1); |
|
|
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d_E1); |
|
|
|
#ifdef PID_ADD_EXTRUSION_RATE |
|
|
|
#if ENABLED(PID_ADD_EXTRUSION_RATE) |
|
|
|
MENU_ITEM_EDIT(float3, MSG_PID_C, &PID_PARAM(Kc,0), 1, 9990); |
|
|
|
#endif//PID_ADD_EXTRUSION_RATE
|
|
|
|
#ifdef PID_PARAMS_PER_EXTRUDER |
|
|
|
#if ENABLED(PID_PARAMS_PER_EXTRUDER) |
|
|
|
#if EXTRUDERS > 1 |
|
|
|
// set up temp variables - undo the default scaling
|
|
|
|
raw_Ki = unscalePID_i(PID_PARAM(Ki,1)); |
|
|
@ -946,7 +946,7 @@ static void lcd_control_temperature_menu() { |
|
|
|
// i is typically a small value so allows values below 1
|
|
|
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I MSG_E2, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E2); |
|
|
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D MSG_E2, &raw_Kd, 1, 9990, copy_and_scalePID_d_E2); |
|
|
|
#ifdef PID_ADD_EXTRUSION_RATE |
|
|
|
#if ENABLED(PID_ADD_EXTRUSION_RATE) |
|
|
|
MENU_ITEM_EDIT(float3, MSG_PID_C MSG_E2, &PID_PARAM(Kc,1), 1, 9990); |
|
|
|
#endif//PID_ADD_EXTRUSION_RATE
|
|
|
|
|
|
|
@ -958,7 +958,7 @@ static void lcd_control_temperature_menu() { |
|
|
|
// i is typically a small value so allows values below 1
|
|
|
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I MSG_E3, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E3); |
|
|
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D MSG_E3, &raw_Kd, 1, 9990, copy_and_scalePID_d_E3); |
|
|
|
#ifdef PID_ADD_EXTRUSION_RATE |
|
|
|
#if ENABLED(PID_ADD_EXTRUSION_RATE) |
|
|
|
MENU_ITEM_EDIT(float3, MSG_PID_C MSG_E3, &PID_PARAM(Kc,2), 1, 9990); |
|
|
|
#endif//PID_ADD_EXTRUSION_RATE
|
|
|
|
|
|
|
@ -970,7 +970,7 @@ static void lcd_control_temperature_menu() { |
|
|
|
// i is typically a small value so allows values below 1
|
|
|
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I MSG_E4, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E4); |
|
|
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D MSG_E4, &raw_Kd, 1, 9990, copy_and_scalePID_d_E4); |
|
|
|
#ifdef PID_ADD_EXTRUSION_RATE |
|
|
|
#if ENABLED(PID_ADD_EXTRUSION_RATE) |
|
|
|
MENU_ITEM_EDIT(float3, MSG_PID_C MSG_E4, &PID_PARAM(Kc,3), 1, 9990); |
|
|
|
#endif//PID_ADD_EXTRUSION_RATE
|
|
|
|
#endif//EXTRUDERS > 3
|
|
|
@ -1006,7 +1006,7 @@ static void lcd_control_temperature_preheat_pla_settings_menu() { |
|
|
|
#if TEMP_SENSOR_BED != 0 |
|
|
|
MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15); |
|
|
|
#endif |
|
|
|
#ifdef EEPROM_SETTINGS |
|
|
|
#if ENABLED(EEPROM_SETTINGS) |
|
|
|
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); |
|
|
|
#endif |
|
|
|
END_MENU(); |
|
|
@ -1027,7 +1027,7 @@ static void lcd_control_temperature_preheat_abs_settings_menu() { |
|
|
|
#if TEMP_SENSOR_BED != 0 |
|
|
|
MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15); |
|
|
|
#endif |
|
|
|
#ifdef EEPROM_SETTINGS |
|
|
|
#if ENABLED(EEPROM_SETTINGS) |
|
|
|
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); |
|
|
|
#endif |
|
|
|
END_MENU(); |
|
|
@ -1041,7 +1041,7 @@ static void lcd_control_temperature_preheat_abs_settings_menu() { |
|
|
|
static void lcd_control_motion_menu() { |
|
|
|
START_MENU(); |
|
|
|
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); |
|
|
|
#ifdef ENABLE_AUTO_BED_LEVELING |
|
|
|
#if ENABLED(ENABLE_AUTO_BED_LEVELING) |
|
|
|
MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); |
|
|
|
#endif |
|
|
|
MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 10, 99000); |
|
|
@ -1064,10 +1064,10 @@ static void lcd_control_motion_menu() { |
|
|
|
MENU_ITEM_EDIT(float52, MSG_YSTEPS, &axis_steps_per_unit[Y_AXIS], 5, 9999); |
|
|
|
MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &axis_steps_per_unit[Z_AXIS], 5, 9999); |
|
|
|
MENU_ITEM_EDIT(float51, MSG_ESTEPS, &axis_steps_per_unit[E_AXIS], 5, 9999); |
|
|
|
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED |
|
|
|
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) |
|
|
|
MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit); |
|
|
|
#endif |
|
|
|
#ifdef SCARA |
|
|
|
#if ENABLED(SCARA) |
|
|
|
MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS],0.5,2); |
|
|
|
MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS],0.5,2); |
|
|
|
#endif |
|
|
@ -1106,10 +1106,10 @@ static void lcd_control_volumetric_menu() { |
|
|
|
* "Control" > "Contrast" submenu |
|
|
|
* |
|
|
|
*/ |
|
|
|
#ifdef HAS_LCD_CONTRAST |
|
|
|
#if ENABLED(HAS_LCD_CONTRAST) |
|
|
|
static void lcd_set_contrast() { |
|
|
|
if (encoderPosition != 0) { |
|
|
|
#ifdef U8GLIB_LM6059_AF |
|
|
|
#if ENABLED(U8GLIB_LM6059_AF) |
|
|
|
lcd_contrast += encoderPosition; |
|
|
|
lcd_contrast &= 0xFF; |
|
|
|
#else |
|
|
@ -1121,7 +1121,7 @@ static void lcd_control_volumetric_menu() { |
|
|
|
u8g.setContrast(lcd_contrast); |
|
|
|
} |
|
|
|
if (lcdDrawUpdate) { |
|
|
|
#ifdef U8GLIB_LM6059_AF |
|
|
|
#if ENABLED(U8GLIB_LM6059_AF) |
|
|
|
lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr3(lcd_contrast)); |
|
|
|
#else |
|
|
|
lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast)); |
|
|
@ -1136,7 +1136,7 @@ static void lcd_control_volumetric_menu() { |
|
|
|
* "Control" > "Retract" submenu |
|
|
|
* |
|
|
|
*/ |
|
|
|
#ifdef FWRETRACT |
|
|
|
#if ENABLED(FWRETRACT) |
|
|
|
static void lcd_control_retract_menu() { |
|
|
|
START_MENU(); |
|
|
|
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); |
|
|
@ -1191,7 +1191,7 @@ void lcd_sdcard_menu() { |
|
|
|
for (uint16_t i = 0; i < fileCnt; i++) { |
|
|
|
if (_menuItemNr == _lineNr) { |
|
|
|
card.getfilename( |
|
|
|
#ifdef SDCARD_RATHERRECENTFIRST |
|
|
|
#if ENABLED(SDCARD_RATHERRECENTFIRST) |
|
|
|
fileCnt-1 - |
|
|
|
#endif |
|
|
|
i |
|
|
@ -1264,7 +1264,7 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01) |
|
|
|
* Handlers for RepRap World Keypad input |
|
|
|
* |
|
|
|
*/ |
|
|
|
#ifdef REPRAPWORLD_KEYPAD |
|
|
|
#if ENABLED(REPRAPWORLD_KEYPAD) |
|
|
|
static void reprapworld_keypad_move_z_up() { |
|
|
|
encoderPosition = 1; |
|
|
|
move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; |
|
|
@ -1307,7 +1307,7 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01) |
|
|
|
* |
|
|
|
*/ |
|
|
|
|
|
|
|
#ifdef LCD_USE_I2C_BUZZER |
|
|
|
#if ENABLED(LCD_USE_I2C_BUZZER) |
|
|
|
void lcd_buzz(long duration, uint16_t freq) { // called from buzz() in Marlin_main.cpp where lcd is unknown
|
|
|
|
lcd.buzz(duration, freq); |
|
|
|
} |
|
|
@ -1317,7 +1317,7 @@ void lcd_quick_feedback() { |
|
|
|
lcdDrawUpdate = 2; |
|
|
|
next_button_update_ms = millis() + 500; |
|
|
|
|
|
|
|
#ifdef LCD_USE_I2C_BUZZER |
|
|
|
#if ENABLED(LCD_USE_I2C_BUZZER) |
|
|
|
#ifndef LCD_FEEDBACK_FREQUENCY_HZ |
|
|
|
#define LCD_FEEDBACK_FREQUENCY_HZ 100 |
|
|
|
#endif |
|
|
@ -1375,7 +1375,7 @@ static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, |
|
|
|
void lcd_init() { |
|
|
|
lcd_implementation_init(); |
|
|
|
|
|
|
|
#ifdef NEWPANEL |
|
|
|
#if ENABLED(NEWPANEL) |
|
|
|
|
|
|
|
SET_INPUT(BTN_EN1); |
|
|
|
SET_INPUT(BTN_EN2); |
|
|
@ -1385,7 +1385,7 @@ void lcd_init() { |
|
|
|
SET_INPUT(BTN_ENC); |
|
|
|
WRITE(BTN_ENC,HIGH); |
|
|
|
#endif |
|
|
|
#ifdef REPRAPWORLD_KEYPAD |
|
|
|
#if ENABLED(REPRAPWORLD_KEYPAD) |
|
|
|
pinMode(SHIFT_CLK,OUTPUT); |
|
|
|
pinMode(SHIFT_LD,OUTPUT); |
|
|
|
pinMode(SHIFT_OUT,INPUT); |
|
|
@ -1393,7 +1393,7 @@ void lcd_init() { |
|
|
|
WRITE(SHIFT_LD,HIGH); |
|
|
|
#endif |
|
|
|
#else // Not NEWPANEL
|
|
|
|
#ifdef SR_LCD_2W_NL // Non latching 2 wire shift register
|
|
|
|
#if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
|
|
|
|
pinMode (SR_DATA_PIN, OUTPUT); |
|
|
|
pinMode (SR_CLK_PIN, OUTPUT); |
|
|
|
#elif defined(SHIFT_CLK) |
|
|
@ -1407,19 +1407,19 @@ void lcd_init() { |
|
|
|
#endif // SR_LCD_2W_NL
|
|
|
|
#endif//!NEWPANEL
|
|
|
|
|
|
|
|
#if defined(SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) |
|
|
|
#if ENABLED(SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) |
|
|
|
pinMode(SDCARDDETECT, INPUT); |
|
|
|
WRITE(SDCARDDETECT, HIGH); |
|
|
|
lcd_oldcardstatus = IS_SD_INSERTED; |
|
|
|
#endif //(SDCARDDETECT > 0)
|
|
|
|
|
|
|
|
#ifdef LCD_HAS_SLOW_BUTTONS |
|
|
|
#if ENABLED(LCD_HAS_SLOW_BUTTONS) |
|
|
|
slow_buttons = 0; |
|
|
|
#endif |
|
|
|
|
|
|
|
lcd_buttons_update(); |
|
|
|
|
|
|
|
#ifdef ULTIPANEL |
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
encoderDiff = 0; |
|
|
|
#endif |
|
|
|
} |
|
|
@ -1456,11 +1456,11 @@ int lcd_strlen_P(const char *s) { |
|
|
|
* Warning: This function is called from interrupt context! |
|
|
|
*/ |
|
|
|
void lcd_update() { |
|
|
|
#ifdef ULTIPANEL |
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
static millis_t return_to_status_ms = 0; |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef LCD_HAS_SLOW_BUTTONS |
|
|
|
#if ENABLED(LCD_HAS_SLOW_BUTTONS) |
|
|
|
slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context
|
|
|
|
#endif |
|
|
|
|
|
|
@ -1471,7 +1471,7 @@ void lcd_update() { |
|
|
|
lcdDrawUpdate = 2; |
|
|
|
lcd_oldcardstatus = IS_SD_INSERTED; |
|
|
|
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
|
|
|
|
#ifdef LCD_PROGRESS_BAR |
|
|
|
#if ENABLED(LCD_PROGRESS_BAR) |
|
|
|
currentMenu == lcd_status_screen |
|
|
|
#endif |
|
|
|
); |
|
|
@ -1490,9 +1490,9 @@ void lcd_update() { |
|
|
|
millis_t ms = millis(); |
|
|
|
if (ms > next_lcd_update_ms) { |
|
|
|
|
|
|
|
#ifdef ULTIPANEL |
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
|
|
|
|
#ifdef REPRAPWORLD_KEYPAD |
|
|
|
#if ENABLED(REPRAPWORLD_KEYPAD) |
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); |
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down(); |
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left(); |
|
|
@ -1507,7 +1507,7 @@ void lcd_update() { |
|
|
|
if (encoderPastThreshold) { |
|
|
|
int32_t encoderMultiplier = 1; |
|
|
|
|
|
|
|
#ifdef ENCODER_RATE_MULTIPLIER |
|
|
|
#if ENABLED(ENCODER_RATE_MULTIPLIER) |
|
|
|
|
|
|
|
if (encoderRateMultiplierEnabled) { |
|
|
|
int32_t encoderMovementSteps = abs(encoderDiff) / ENCODER_PULSES_PER_STEP; |
|
|
@ -1520,7 +1520,7 @@ void lcd_update() { |
|
|
|
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; |
|
|
|
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; |
|
|
|
|
|
|
|
#ifdef ENCODER_RATE_MULTIPLIER_DEBUG |
|
|
|
#if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG) |
|
|
|
SERIAL_ECHO_START; |
|
|
|
SERIAL_ECHO("Enc Step Rate: "); |
|
|
|
SERIAL_ECHO(encoderStepRate); |
|
|
@ -1554,7 +1554,7 @@ void lcd_update() { |
|
|
|
lcd_status_update_delay--; |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef DOGLCD // Changes due to different driver architecture of the DOGM display
|
|
|
|
#if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
|
|
|
|
if (lcdDrawUpdate) { |
|
|
|
blink++; // Variable for fan animation and alive dot
|
|
|
|
u8g.firstPage(); |
|
|
@ -1571,15 +1571,15 @@ void lcd_update() { |
|
|
|
(*currentMenu)(); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef LCD_HAS_STATUS_INDICATORS |
|
|
|
#if ENABLED(LCD_HAS_STATUS_INDICATORS) |
|
|
|
lcd_implementation_update_indicators(); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef ULTIPANEL |
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
|
|
|
|
// Return to Status Screen after a timeout
|
|
|
|
if (currentMenu != lcd_status_screen && |
|
|
|
#ifdef MANUAL_BED_LEVELING |
|
|
|
#if ENABLED(MANUAL_BED_LEVELING) |
|
|
|
currentMenu != _lcd_level_bed && |
|
|
|
currentMenu != _lcd_level_bed_homing && |
|
|
|
#endif |
|
|
@ -1603,7 +1603,7 @@ void lcd_ignore_click(bool b) { |
|
|
|
} |
|
|
|
|
|
|
|
void lcd_finishstatus(bool persist=false) { |
|
|
|
#ifdef LCD_PROGRESS_BAR |
|
|
|
#if ENABLED(LCD_PROGRESS_BAR) |
|
|
|
progress_bar_ms = millis(); |
|
|
|
#if PROGRESS_MSG_EXPIRE > 0 |
|
|
|
expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE; |
|
|
@ -1611,12 +1611,12 @@ void lcd_finishstatus(bool persist=false) { |
|
|
|
#endif |
|
|
|
lcdDrawUpdate = 2; |
|
|
|
|
|
|
|
#ifdef FILAMENT_LCD_DISPLAY |
|
|
|
#if ENABLED(FILAMENT_LCD_DISPLAY) |
|
|
|
previous_lcd_status_ms = millis(); //get status message to show up for a while
|
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
#if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 |
|
|
|
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 |
|
|
|
void dontExpireStatus() { expire_status_ms = 0; } |
|
|
|
#endif |
|
|
|
|
|
|
@ -1650,21 +1650,21 @@ void lcd_setstatuspgm(const char* message, uint8_t level) { |
|
|
|
|
|
|
|
void lcd_setalertstatuspgm(const char* message) { |
|
|
|
lcd_setstatuspgm(message, 1); |
|
|
|
#ifdef ULTIPANEL |
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
lcd_return_to_status(); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
void lcd_reset_alert_level() { lcd_status_message_level = 0; } |
|
|
|
|
|
|
|
#ifdef HAS_LCD_CONTRAST |
|
|
|
#if ENABLED(HAS_LCD_CONTRAST) |
|
|
|
void lcd_setcontrast(uint8_t value) { |
|
|
|
lcd_contrast = value & 0x3F; |
|
|
|
u8g.setContrast(lcd_contrast); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef ULTIPANEL |
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
|
|
|
|
/**
|
|
|
|
* Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement) |
|
|
@ -1683,7 +1683,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } |
|
|
|
* Warning: This function is called from interrupt context! |
|
|
|
*/ |
|
|
|
void lcd_buttons_update() { |
|
|
|
#ifdef NEWPANEL |
|
|
|
#if ENABLED(NEWPANEL) |
|
|
|
uint8_t newbutton = 0; |
|
|
|
if (READ(BTN_EN1) == 0) newbutton |= EN_A; |
|
|
|
if (READ(BTN_EN2) == 0) newbutton |= EN_B; |
|
|
@ -1691,10 +1691,10 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } |
|
|
|
if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C; |
|
|
|
#endif |
|
|
|
buttons = newbutton; |
|
|
|
#ifdef LCD_HAS_SLOW_BUTTONS |
|
|
|
#if ENABLED(LCD_HAS_SLOW_BUTTONS) |
|
|
|
buttons |= slow_buttons; |
|
|
|
#endif |
|
|
|
#ifdef REPRAPWORLD_KEYPAD |
|
|
|
#if ENABLED(REPRAPWORLD_KEYPAD) |
|
|
|
// for the reprapworld_keypad
|
|
|
|
uint8_t newbutton_reprapworld_keypad=0; |
|
|
|
WRITE(SHIFT_LD, LOW); |
|
|
@ -1749,7 +1749,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } |
|
|
|
} |
|
|
|
|
|
|
|
bool lcd_detected(void) { |
|
|
|
#if (defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE) |
|
|
|
#if (ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)) && ENABLED(DETECT_DEVICE) |
|
|
|
return lcd.LcdDetected() == 1; |
|
|
|
#else |
|
|
|
return true; |
|
|
@ -1993,7 +1993,7 @@ char *ftostr52(const float &x) { |
|
|
|
return conv; |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef MANUAL_BED_LEVELING |
|
|
|
#if ENABLED(MANUAL_BED_LEVELING) |
|
|
|
|
|
|
|
static int _lcd_level_bed_position; |
|
|
|
|
|
|
|