|
@@ -1,4 +1,7 @@
|
|
|
//! @file
|
|
|
+//! @date Aug 28, 2019
|
|
|
+//! @author mkbel
|
|
|
+//! @brief LCD
|
|
|
|
|
|
#include "temperature.h"
|
|
|
#include "ultralcd.h"
|
|
@@ -58,17 +61,9 @@ uint8_t SilentModeMenu_MMU = 1; //activate mmu unit stealth mode
|
|
|
|
|
|
int8_t FSensorStateMenu = 1;
|
|
|
|
|
|
-int8_t CrashDetectMenu = 1;
|
|
|
-
|
|
|
-
|
|
|
extern bool fsensor_enable();
|
|
|
extern void fsensor_disable();
|
|
|
|
|
|
-#ifdef TMC2130
|
|
|
-extern void crashdet_enable();
|
|
|
-extern void crashdet_disable();
|
|
|
-#endif //TMC2130
|
|
|
-
|
|
|
|
|
|
#ifdef SDCARD_SORT_ALPHA
|
|
|
bool presort_flag = false;
|
|
@@ -103,6 +98,8 @@ uint8_t lcd_status_message_level;
|
|
|
char lcd_status_message[LCD_WIDTH + 1] = ""; //////WELCOME!
|
|
|
unsigned char firstrun = 1;
|
|
|
|
|
|
+static uint8_t lay1cal_filament = 0;
|
|
|
+
|
|
|
|
|
|
static const char separator[] PROGMEM = "--------------------";
|
|
|
|
|
@@ -120,14 +117,7 @@ static void lcd_tune_menu();
|
|
|
//static void lcd_move_menu();
|
|
|
static void lcd_settings_menu();
|
|
|
static void lcd_calibration_menu();
|
|
|
-#ifdef LINEARITY_CORRECTION
|
|
|
-static void lcd_settings_menu_back();
|
|
|
-#endif //LINEARITY_CORRECTION
|
|
|
static void lcd_control_temperature_menu();
|
|
|
-static void lcd_control_temperature_preheat_pla_settings_menu();
|
|
|
-static void lcd_control_temperature_preheat_abs_settings_menu();
|
|
|
-static void lcd_control_motion_menu();
|
|
|
-static void lcd_control_volumetric_menu();
|
|
|
static void lcd_settings_linearity_correction_menu_save();
|
|
|
static void prusa_stat_printerstatus(int _status);
|
|
|
static void prusa_stat_farm_number();
|
|
@@ -135,17 +125,20 @@ static void prusa_stat_diameter();
|
|
|
static void prusa_stat_temperatures();
|
|
|
static void prusa_stat_printinfo();
|
|
|
static void lcd_farm_no();
|
|
|
-//static void lcd_menu_extruder_info(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
|
|
|
static void lcd_menu_xyz_y_min();
|
|
|
static void lcd_menu_xyz_skew();
|
|
|
static void lcd_menu_xyz_offset();
|
|
|
static void lcd_menu_fails_stats_mmu();
|
|
|
static void lcd_menu_fails_stats_mmu_print();
|
|
|
static void lcd_menu_fails_stats_mmu_total();
|
|
|
+static void mmu_unload_filament();
|
|
|
+static void lcd_v2_calibration();
|
|
|
//static void lcd_menu_show_sensors_state(); // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
|
|
|
|
|
|
static void mmu_fil_eject_menu();
|
|
|
static void mmu_load_to_nozzle_menu();
|
|
|
+static void preheat_or_continue();
|
|
|
+
|
|
|
#ifdef MMU_HAS_CUTTER
|
|
|
static void mmu_cut_filament_menu();
|
|
|
#endif //MMU_HAS_CUTTER
|
|
@@ -259,10 +252,6 @@ void lcd_finishstatus();
|
|
|
static void lcd_sdcard_menu();
|
|
|
static void lcd_sheet_menu();
|
|
|
|
|
|
-static void lcd_select_sheet_0_menu();
|
|
|
-static void lcd_select_sheet_1_menu();
|
|
|
-static void lcd_select_sheet_2_menu();
|
|
|
-
|
|
|
#ifdef DELTA_CALIBRATION_MENU
|
|
|
static void lcd_delta_calibrate_menu();
|
|
|
#endif // DELTA_CALIBRATION_MENU
|
|
@@ -876,18 +865,23 @@ void lcdui_print_status_line(void)
|
|
|
lcd_print(' ');
|
|
|
}
|
|
|
|
|
|
+//! @brief Show Status Screen
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |N 000/000D Z000.0 |
|
|
|
+//! |B 000/000D F100% |
|
|
|
+//! |USB100% T0 t--:-- |
|
|
|
+//! |Status line.........|
|
|
|
+//! ----------------------
|
|
|
+//! N - nozzle temp symbol LCD_STR_THERMOMETER
|
|
|
+//! D - Degree sysmbol LCD_STR_DEGREE
|
|
|
+//! B - bed temp symbol LCD_STR_BEDTEMP
|
|
|
+//! F - feedrate symbol LCD_STR_FEEDRATE
|
|
|
+//! t - clock symbol LCD_STR_THERMOMETER
|
|
|
+//! @endcode
|
|
|
void lcdui_print_status_screen(void)
|
|
|
{
|
|
|
-//|01234567890123456789|
|
|
|
-//|N 000/000D Z000.0 |
|
|
|
-//|B 000/000D F100% |
|
|
|
-//|USB100% T0 t--:-- |
|
|
|
-//|Status line.........|
|
|
|
-//----------------------
|
|
|
-//N - nozzle temp symbol LCD_STR_THERMOMETER
|
|
|
-//B - bed temp symbol LCD_STR_BEDTEMP
|
|
|
-//F - feedrate symbol LCD_STR_FEEDRATE
|
|
|
-//t - clock symbol LCD_STR_THERMOMETER
|
|
|
|
|
|
lcd_set_cursor(0, 0); //line 0
|
|
|
|
|
@@ -1357,46 +1351,29 @@ void lcd_commands()
|
|
|
if (lcd_commands_type == LcdCommands::Layer1Cal)
|
|
|
{
|
|
|
char cmd1[30];
|
|
|
- static uint8_t filament = 0;
|
|
|
|
|
|
if(lcd_commands_step>1) lcd_timeoutToStatus.start(); //if user dont confirm live adjust Z value by pressing the knob, we are saving last value by timeout to status screen
|
|
|
|
|
|
- if (!blocks_queued() && cmd_buffer_empty())
|
|
|
+ if (!blocks_queued() && cmd_buffer_empty() && !saved_printing)
|
|
|
{
|
|
|
switch(lcd_commands_step)
|
|
|
{
|
|
|
case 0:
|
|
|
- lcd_commands_step = 10;
|
|
|
- break;
|
|
|
- case 20:
|
|
|
- filament = 0;
|
|
|
- lcd_commands_step = 10;
|
|
|
+ lcd_commands_step = 11;
|
|
|
break;
|
|
|
- case 21:
|
|
|
- filament = 1;
|
|
|
- lcd_commands_step = 10;
|
|
|
- break;
|
|
|
- case 22:
|
|
|
- filament = 2;
|
|
|
- lcd_commands_step = 10;
|
|
|
- break;
|
|
|
- case 23:
|
|
|
- filament = 3;
|
|
|
- lcd_commands_step = 10;
|
|
|
- break;
|
|
|
- case 24:
|
|
|
- filament = 4;
|
|
|
+ case 11:
|
|
|
+ lay1cal_wait_preheat();
|
|
|
lcd_commands_step = 10;
|
|
|
break;
|
|
|
case 10:
|
|
|
- lay1cal_preheat();
|
|
|
+ lay1cal_load_filament(cmd1, lay1cal_filament);
|
|
|
lcd_commands_step = 9;
|
|
|
break;
|
|
|
case 9:
|
|
|
lcd_clear();
|
|
|
menu_depth = 0;
|
|
|
menu_submenu(lcd_babystep_z);
|
|
|
- lay1cal_intro_line(cmd1, filament);
|
|
|
+ lay1cal_intro_line();
|
|
|
lcd_commands_step = 8;
|
|
|
break;
|
|
|
case 8:
|
|
@@ -1651,7 +1628,7 @@ void lcd_return_to_status()
|
|
|
lcd_refresh(); // to maybe revive the LCD if static electricity killed it.
|
|
|
menu_goto(lcd_status_screen, 0, false, true);
|
|
|
menu_depth = 0;
|
|
|
- eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
|
|
|
+ eFilamentAction = FilamentAction::None; // i.e. non-autoLoad
|
|
|
}
|
|
|
|
|
|
//! @brief Pause print, disable nozzle heater, move to park position
|
|
@@ -1665,7 +1642,7 @@ void lcd_pause_print()
|
|
|
{
|
|
|
lcd_commands_type = LcdCommands::LongPause;
|
|
|
}
|
|
|
- SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSE); //pause for octoprint
|
|
|
+ SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); //pause for octoprint
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1676,119 +1653,59 @@ static void lcd_move_menu_axis();
|
|
|
|
|
|
/* Menu implementation */
|
|
|
|
|
|
-void lcd_preheat_farm()
|
|
|
-{
|
|
|
- setTargetHotend0(FARM_PREHEAT_HOTEND_TEMP);
|
|
|
- setTargetBed(FARM_PREHEAT_HPB_TEMP);
|
|
|
- fanSpeed = 0;
|
|
|
- lcd_return_to_status();
|
|
|
- setWatch(); // heater sanity check timer
|
|
|
-}
|
|
|
-
|
|
|
-void lcd_preheat_farm_nozzle()
|
|
|
-{
|
|
|
- setTargetHotend0(FARM_PREHEAT_HOTEND_TEMP);
|
|
|
- setTargetBed(0);
|
|
|
- fanSpeed = 0;
|
|
|
- lcd_return_to_status();
|
|
|
- setWatch(); // heater sanity check timer
|
|
|
-}
|
|
|
-
|
|
|
-void lcd_preheat_pla()
|
|
|
-{
|
|
|
- setTargetHotend0(PLA_PREHEAT_HOTEND_TEMP);
|
|
|
- if (!wizard_active) setTargetBed(PLA_PREHEAT_HPB_TEMP);
|
|
|
- fanSpeed = 0;
|
|
|
- lcd_return_to_status();
|
|
|
- setWatch(); // heater sanity check timer
|
|
|
- if (wizard_active) lcd_wizard(WizState::Unload);
|
|
|
-}
|
|
|
-
|
|
|
-void lcd_preheat_abs()
|
|
|
-{
|
|
|
- setTargetHotend0(ABS_PREHEAT_HOTEND_TEMP);
|
|
|
- if (!wizard_active) setTargetBed(ABS_PREHEAT_HPB_TEMP);
|
|
|
- fanSpeed = 0;
|
|
|
- lcd_return_to_status();
|
|
|
- setWatch(); // heater sanity check timer
|
|
|
- if (wizard_active) lcd_wizard(WizState::Unload);
|
|
|
-}
|
|
|
-
|
|
|
-void lcd_preheat_pp()
|
|
|
-{
|
|
|
- setTargetHotend0(PP_PREHEAT_HOTEND_TEMP);
|
|
|
- if (!wizard_active) setTargetBed(PP_PREHEAT_HPB_TEMP);
|
|
|
- fanSpeed = 0;
|
|
|
- lcd_return_to_status();
|
|
|
- setWatch(); // heater sanity check timer
|
|
|
- if (wizard_active) lcd_wizard(WizState::Unload);
|
|
|
-}
|
|
|
-
|
|
|
-void lcd_preheat_pet()
|
|
|
-{
|
|
|
- setTargetHotend0(PET_PREHEAT_HOTEND_TEMP);
|
|
|
- if (!wizard_active) setTargetBed(PET_PREHEAT_HPB_TEMP);
|
|
|
- fanSpeed = 0;
|
|
|
- lcd_return_to_status();
|
|
|
- setWatch(); // heater sanity check timer
|
|
|
- if (wizard_active) lcd_wizard(WizState::Unload);
|
|
|
-}
|
|
|
-
|
|
|
-void lcd_preheat_hips()
|
|
|
-{
|
|
|
- setTargetHotend0(HIPS_PREHEAT_HOTEND_TEMP);
|
|
|
- if (!wizard_active) setTargetBed(HIPS_PREHEAT_HPB_TEMP);
|
|
|
- fanSpeed = 0;
|
|
|
- lcd_return_to_status();
|
|
|
- setWatch(); // heater sanity check timer
|
|
|
- if (wizard_active) lcd_wizard(WizState::Unload);
|
|
|
-}
|
|
|
-
|
|
|
-void lcd_preheat_flex()
|
|
|
-{
|
|
|
- setTargetHotend0(FLEX_PREHEAT_HOTEND_TEMP);
|
|
|
- if (!wizard_active) setTargetBed(FLEX_PREHEAT_HPB_TEMP);
|
|
|
- fanSpeed = 0;
|
|
|
- lcd_return_to_status();
|
|
|
- setWatch(); // heater sanity check timer
|
|
|
- if (wizard_active) lcd_wizard(WizState::Unload);
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-void lcd_cooldown()
|
|
|
+static void lcd_cooldown()
|
|
|
{
|
|
|
setAllTargetHotends(0);
|
|
|
setTargetBed(0);
|
|
|
fanSpeed = 0;
|
|
|
+ eFilamentAction = FilamentAction::None;
|
|
|
lcd_return_to_status();
|
|
|
}
|
|
|
|
|
|
+//! @brief append text label with a colon and format it into a fixed size output buffer
|
|
|
+//! It would have been much easier if there was a ':' in the labels.
|
|
|
+//! But since the texts like Bed, Nozzle and PINDA are used in other places
|
|
|
+//! it is better to reuse these texts even though it requires some extra formatting code.
|
|
|
+//! @param [in] ipgmLabel pointer to string in PROGMEM
|
|
|
+//! @param [out] pointer to string in RAM which will receive the formatted text. Must be allocated to appropriate size
|
|
|
+//! @param [in] dstSize allocated length of dst
|
|
|
+static void pgmtext_with_colon(const char *ipgmLabel, char *dst, uint8_t dstSize){
|
|
|
+ uint8_t i = 0;
|
|
|
+ for(; i < dstSize - 2; ++i){ // 2 byte less than buffer, we'd be adding a ':' to the end
|
|
|
+ uint8_t b = pgm_read_byte(ipgmLabel + i);
|
|
|
+ if( ! b )
|
|
|
+ break;
|
|
|
+ dst[i] = b;
|
|
|
+ }
|
|
|
+ dst[i] = ':'; // append the colon
|
|
|
+ ++i;
|
|
|
+ for(; i < dstSize - 1; ++i) // fill the rest with spaces
|
|
|
+ dst[i] = ' ';
|
|
|
+ dst[dstSize-1] = '\0'; // terminate the string properly
|
|
|
+}
|
|
|
|
|
|
+//! @brief Show Extruder Info
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |Nozzle FAN: 0000 RPM| FAN c=10 r=1 SPEED c=3 r=1
|
|
|
+//! |Print FAN: 0000 RPM| FAN c=10 r=1 SPEED c=3 r=1
|
|
|
+//! |Fil. Xd:000 Yd:000 | Fil. c=4 r=1
|
|
|
+//! |Int: 000 Shut: 000 | Int: c=4 r=1 Shut: c=4 r=1
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()")
|
|
|
{
|
|
|
-//|01234567890123456789|
|
|
|
-//|Nozzle FAN: RPM|
|
|
|
-//|Print FAN: RPM|
|
|
|
-//|Fil. Xd: Yd: |
|
|
|
-//|Int: Shut: |
|
|
|
-//----------------------
|
|
|
- int fan_speed_RPM[2];
|
|
|
- // Display Nozzle fan RPM
|
|
|
- fan_speed_RPM[0] = 60*fan_speed[0];
|
|
|
- fan_speed_RPM[1] = 60*fan_speed[1];
|
|
|
-
|
|
|
- lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
|
|
|
- lcd_home();
|
|
|
- lcd_printf_P(_N(
|
|
|
- "%S: %4d RPM\n"
|
|
|
- "%S: %4d RPM\n"
|
|
|
- ),
|
|
|
- _i("Nozzle FAN"),
|
|
|
- fan_speed_RPM[0],
|
|
|
- _i("Print FAN"),
|
|
|
- fan_speed_RPM[1]
|
|
|
- );
|
|
|
+ // Display Nozzle fan RPM
|
|
|
+ lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
+ lcd_home();
|
|
|
+ static const size_t maxChars = 12;
|
|
|
+ char nozzle[maxChars], print[maxChars];
|
|
|
+ pgmtext_with_colon(_i("Nozzle FAN"), nozzle, maxChars); ////c=10 r=1
|
|
|
+ pgmtext_with_colon(_i("Print FAN"), print, maxChars); ////c=10 r=1
|
|
|
+ lcd_printf_P(_N("%s %4d RPM\n" "%s %4d RPM\n"), nozzle, 60*fan_speed[0], print, 60*fan_speed[1] );
|
|
|
|
|
|
#ifdef PAT9125
|
|
|
// Display X and Y difference from Filament sensor
|
|
@@ -1808,8 +1725,9 @@ void lcd_menu_extruder_info() // NOT static due to using ins
|
|
|
if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal))
|
|
|
pat9125_update();
|
|
|
lcd_printf_P(_N(
|
|
|
- "Fil. Xd:%3d Yd:%3d\n"
|
|
|
- "Int: %3d Shut: %3d"
|
|
|
+ "Fil. Xd:%3d Yd:%3d\n" ////c=4 r=1
|
|
|
+ "Int: %3d " ////c=4 r=1
|
|
|
+ "Shut: %3d" ////c=4 r=1
|
|
|
),
|
|
|
pat9125_x, pat9125_y,
|
|
|
pat9125_b, pat9125_s
|
|
@@ -1821,125 +1739,187 @@ void lcd_menu_extruder_info() // NOT static due to using ins
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
|
|
|
|
+//! @brief Show Fails Statistics MMU
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! | Main | c=18 r=1
|
|
|
+//! | Last print | c=18 r=1
|
|
|
+//! | Total | c=18 r=1
|
|
|
+//! | |
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
static void lcd_menu_fails_stats_mmu()
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Last print"), lcd_menu_fails_stats_mmu_print);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Total"), lcd_menu_fails_stats_mmu_total);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Last print"), lcd_menu_fails_stats_mmu_print); ////c=18 r=1
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Total"), lcd_menu_fails_stats_mmu_total); ////c=18 r=1
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
|
+//! @brief Show Last Print Failures Statistics MMU
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |Last print failures | c=20 r=1
|
|
|
+//! | MMU fails: 000| c=14 r=1
|
|
|
+//! | MMU load fails: 000| c=14 r=1
|
|
|
+//! | |
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_fails_stats_mmu_print()
|
|
|
{
|
|
|
-//01234567890123456789
|
|
|
-//Last print failures
|
|
|
-// MMU fails 000
|
|
|
-// MMU load fails 000
|
|
|
-//
|
|
|
-//////////////////////
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
uint8_t fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL);
|
|
|
uint16_t load_fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL);
|
|
|
- lcd_home();
|
|
|
- lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d"), _i("Last print failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails);
|
|
|
- menu_back_if_clicked_fb();
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d"),
|
|
|
+ _i("Last print failures"), ////c=20 r=1
|
|
|
+ _i("MMU fails"), fails, ////c=14 r=1
|
|
|
+ _i("MMU load fails"), load_fails); ////c=14 r=1
|
|
|
+ menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
|
+//! @brief Show Total Failures Statistics MMU
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |Total failures | c=20 r=1
|
|
|
+//! | MMU fails: 000| c=14 r=1
|
|
|
+//! | MMU load fails: 000| c=14 r=1
|
|
|
+//! | MMU power fails:000| c=14 r=1
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_fails_stats_mmu_total()
|
|
|
{
|
|
|
-//01234567890123456789
|
|
|
-//Last print failures
|
|
|
-// MMU fails 000
|
|
|
-// MMU load fails 000
|
|
|
-//
|
|
|
-//////////////////////
|
|
|
mmu_command(MmuCmd::S3);
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
uint8_t fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL_TOT);
|
|
|
uint16_t load_fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL_TOT);
|
|
|
- lcd_home();
|
|
|
- lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d\n" " %S %-3d"), _i("Total failures"), _i("MMU fails"), fails, _i("MMU load fails"), load_fails, _i("MMU power fails"), mmu_power_failures);
|
|
|
- menu_back_if_clicked_fb();
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d\n" " %-16.16S%-3d"),
|
|
|
+ _i("Total failures"), ////c=20 r=1
|
|
|
+ _i("MMU fails"), fails, ////c=14 r=1
|
|
|
+ _i("MMU load fails"), load_fails, ////c=14 r=1
|
|
|
+ _i("MMU power fails"), mmu_power_failures); ////c=14 r=1
|
|
|
+ menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
|
#if defined(TMC2130) && defined(FILAMENT_SENSOR)
|
|
|
+static const char failStatsFmt[] PROGMEM = "%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d\n" " %-7.7SX %-3d Y %-3d";
|
|
|
+
|
|
|
+//! @brief Show Total Failures Statistics MMU
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |Total failures | c=20 r=1
|
|
|
+//! | Power failures: 000| c=14 r=1
|
|
|
+//! | Filam. runouts: 000| c=14 r=1
|
|
|
+//! | Crash X:000 Y:000| c=7 r=1
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_fails_stats_total()
|
|
|
{
|
|
|
-//01234567890123456789
|
|
|
-//Total failures
|
|
|
-// Power failures 000
|
|
|
-// Filam. runouts 000
|
|
|
-// Crash X 000 Y 000
|
|
|
-//////////////////////
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
uint16_t power = eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT);
|
|
|
uint16_t filam = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT);
|
|
|
uint16_t crashX = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT);
|
|
|
uint16_t crashY = eeprom_read_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT);
|
|
|
- lcd_home();
|
|
|
- lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d\n" " %S X %-3d Y %-3d"), _i("Total failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
|
|
|
- menu_back_if_clicked_fb();
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(failStatsFmt,
|
|
|
+ _i("Total failures"), ////c=20 r=1
|
|
|
+ _i("Power failures"), power, ////c=14 r=1
|
|
|
+ _i("Filam. runouts"), filam, ////c=14 r=1
|
|
|
+ _i("Crash"), crashX, crashY); ////c=7 r=1
|
|
|
+ menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
|
+//! @brief Show Last Print Failures Statistics
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |Last print failures | c=20 r=1
|
|
|
+//! | Power failures 000| c=14 r=1
|
|
|
+//! | Filam. runouts 000| c=14 r=1
|
|
|
+//! | Crash X:000 Y:000| c=7 r=1
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_fails_stats_print()
|
|
|
{
|
|
|
-//01234567890123456789
|
|
|
-//Last print failures
|
|
|
-// Power failures 000
|
|
|
-// Filam. runouts 000
|
|
|
-// Crash X 000 Y 000
|
|
|
-//////////////////////
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT);
|
|
|
uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT);
|
|
|
uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X);
|
|
|
uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y);
|
|
|
- lcd_home();
|
|
|
- lcd_printf_P(PSTR("%S\n" " %S %-3d\n" " %S %-3d\n" " %S X %-3d Y %-3d"), _i("Last print failures"), _i("Power failures"), power, _i("Filam. runouts"), filam, _i("Crash"), crashX, crashY);
|
|
|
- menu_back_if_clicked_fb();
|
|
|
-}
|
|
|
+ lcd_home();
|
|
|
+ lcd_printf_P(failStatsFmt,
|
|
|
+ _i("Last print failures"), ////c=20 r=1
|
|
|
+ _i("Power failures"), power, ////c=14 r=1
|
|
|
+ _i("Filam. runouts"), filam, ////c=14 r=1
|
|
|
+ _i("Crash"), crashX, crashY); ////c=7 r=1
|
|
|
+ menu_back_if_clicked_fb();
|
|
|
+}
|
|
|
+
|
|
|
+//! @brief Open fail statistics menu
|
|
|
+//!
|
|
|
+//! This version of function is used, when there is filament sensor,
|
|
|
+//! power failure and crash detection.
|
|
|
+//! There are Last print and Total menu items.
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! | Main | c=18 r=1
|
|
|
+//! | Last print | c=18 r=1
|
|
|
+//! | Total | c=18 r=1
|
|
|
+//! | |
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
|
|
|
-/**
|
|
|
- * @brief Open fail statistics menu
|
|
|
- *
|
|
|
- * This version of function is used, when there is filament sensor,
|
|
|
- * power failure and crash detection.
|
|
|
- * There are Last print and Total menu items.
|
|
|
- */
|
|
|
static void lcd_menu_fails_stats()
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Last print"), lcd_menu_fails_stats_print);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Total"), lcd_menu_fails_stats_total);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Last print"), lcd_menu_fails_stats_print); ////c=18 r=1
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Total"), lcd_menu_fails_stats_total); ////c=18 r=1
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
|
#elif defined(FILAMENT_SENSOR)
|
|
|
-/**
|
|
|
- * @brief Print last print and total filament run outs
|
|
|
- *
|
|
|
- * This version of function is used, when there is filament sensor,
|
|
|
- * but no other sensors (e.g. power failure, crash detection).
|
|
|
- *
|
|
|
- * Example screen:
|
|
|
- * @code
|
|
|
- * 01234567890123456789
|
|
|
- * Last print failures
|
|
|
- * Filam. runouts 0
|
|
|
- * Total failures
|
|
|
- * Filam. runouts 5
|
|
|
- * @endcode
|
|
|
- */
|
|
|
+static const char failStatsFmt[] PROGMEM = "%S\n" " %-16.16S%-3d\n" "%S\n" " %-16.16S%-3d\n";
|
|
|
+//!
|
|
|
+//! @brief Print last print and total filament run outs
|
|
|
+//!
|
|
|
+//! This version of function is used, when there is filament sensor,
|
|
|
+//! but no other sensors (e.g. power failure, crash detection).
|
|
|
+//!
|
|
|
+//! Example screen:
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |Last print failures | c=20 r=1
|
|
|
+//! | Filam. runouts 000| c=14 r=1
|
|
|
+//! |Total failures | c=20 r=1
|
|
|
+//! | Filam. runouts 000| c=14 r=1
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_fails_stats()
|
|
|
{
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT);
|
|
|
uint16_t filamentTotal = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT);
|
|
|
lcd_home();
|
|
|
- lcd_printf_P(PSTR("Last print failures\n" " Filam. runouts %-3d\n" "Total failures\n" " Filam. runouts %-3d"), filamentLast, filamentTotal);
|
|
|
- menu_back_if_clicked();
|
|
|
+ lcd_printf_P(failStatsFmt,
|
|
|
+ _i("Last print failures"), ////c=20 r=1
|
|
|
+ _i("Filam. runouts"), filamentLast, ////c=14 r=1
|
|
|
+ _i("Total failures"), ////c=20 r=1
|
|
|
+ _i("Filam. runouts"), filamentTotal); ////c=14 r=1
|
|
|
+
|
|
|
+ menu_back_if_clicked();
|
|
|
}
|
|
|
#else
|
|
|
static void lcd_menu_fails_stats()
|
|
@@ -1959,28 +1939,65 @@ extern char* __malloc_heap_start;
|
|
|
extern char* __malloc_heap_end;
|
|
|
#endif //DEBUG_STACK_MONITOR
|
|
|
|
|
|
+//! @brief Show Debug Information
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |RAM statistics | c=20 r=1
|
|
|
+//! | SP_min: 0000| c=14 r=1
|
|
|
+//! | heap_start: 0000| c=14 r=1
|
|
|
+//! | heap_end: 0000| c=14 r=1
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_debug()
|
|
|
{
|
|
|
#ifdef DEBUG_STACK_MONITOR
|
|
|
lcd_home();
|
|
|
- lcd_printf_P(PSTR("RAM statistics\n" " SP_min: 0x%04x\n" " heap_start: 0x%04x\n" " heap_end: 0x%04x"), SP_min, __malloc_heap_start, __malloc_heap_end);
|
|
|
+ lcd_printf_P(PSTR("RAM statistics\n" ////c=20 r=1
|
|
|
+ " SP_min: 0x%04x\n" ////c=14 r=1
|
|
|
+ " heap_start: 0x%04x\n" ////c=14 r=1
|
|
|
+ " heap_end: 0x%04x"), SP_min, __malloc_heap_start, __malloc_heap_end); ////c=14 r=1
|
|
|
#endif //DEBUG_STACK_MONITOR
|
|
|
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
#endif /* DEBUG_BUILD */
|
|
|
|
|
|
+//! @brief common line print for lcd_menu_temperatures
|
|
|
+//! @param [in] ipgmLabel pointer to string in PROGMEM
|
|
|
+//! @param [in] value to be printed behind the label
|
|
|
+static void lcd_menu_temperatures_line(const char *ipgmLabel, int value){
|
|
|
+ static const size_t maxChars = 15;
|
|
|
+ char tmp[maxChars];
|
|
|
+ pgmtext_with_colon(ipgmLabel, tmp, maxChars);
|
|
|
+ lcd_printf_P(PSTR(" %s%3d\x01 \n"), tmp, value); // no need to add -14.14 to string alignment
|
|
|
+}
|
|
|
+
|
|
|
+//! @brief Show Temperatures
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! | Nozzle: 000D| c=14 r=1
|
|
|
+//! | Bed: 000D| c=14 r=1
|
|
|
+//! | Ambient: 000D| c=14 r=1
|
|
|
+//! | PINDA: 000D| c=14 r=1
|
|
|
+//! ----------------------
|
|
|
+//! D - Degree sysmbol LCD_STR_DEGREE
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_temperatures()
|
|
|
{
|
|
|
- lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
- lcd_home();
|
|
|
- lcd_printf_P(PSTR(" %S: %d%c \n" " %S: %d%c \n"), _i("Nozzle"), (int)current_temperature[0], '\x01', _i("Bed"), (int)current_temperature_bed, '\x01');
|
|
|
+ lcd_timeoutToStatus.stop(); //infinite timeout
|
|
|
+ lcd_home();
|
|
|
+ lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); ////c=14 r=1
|
|
|
+ lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); ////c=14 r=1
|
|
|
#ifdef AMBIENT_THERMISTOR
|
|
|
- lcd_printf_P(PSTR(" %S: %d%c\n" " PINDA: %d%c"), _i("Ambient"), (int)current_temperature_ambient, '\x01', (int)current_temperature_pinda, '\x01');
|
|
|
-#else //AMBIENT_THERMISTOR
|
|
|
- lcd_printf_P(PSTR(" PINDA: %d%c"), (int)current_temperature_pinda, '\x01');
|
|
|
+ lcd_menu_temperatures_line( _i("Ambient"), (int)current_temperature_ambient ); ////c=14 r=1
|
|
|
#endif //AMBIENT_THERMISTOR
|
|
|
-
|
|
|
+#ifdef PINDA_THERMISTOR
|
|
|
+ lcd_menu_temperatures_line( _i("PINDA"), (int)current_temperature_pinda ); ////c=14 r=1
|
|
|
+#endif //PINDA_THERMISTOR
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
|
|
|
@@ -1989,6 +2006,17 @@ static void lcd_menu_temperatures()
|
|
|
#define VOLT_DIV_R2 2370
|
|
|
#define VOLT_DIV_FAC ((float)VOLT_DIV_R2 / (VOLT_DIV_R2 + VOLT_DIV_R1))
|
|
|
#define VOLT_DIV_REF 5
|
|
|
+//! @brief Show Voltages
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! | |
|
|
|
+//! | PWR: 00.0V | c=12 r=1
|
|
|
+//! | Bed: 00.0V | c=12 r=1
|
|
|
+//! | |
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_voltages()
|
|
|
{
|
|
|
lcd_timeoutToStatus.stop(); //infinite timeout
|
|
@@ -2001,6 +2029,17 @@ static void lcd_menu_voltages()
|
|
|
#endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
+//! @brief Show Belt Status
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! | Belt status | c=18 r=1
|
|
|
+//! | X: 000 |
|
|
|
+//! | Y: 000 |
|
|
|
+//! | |
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_belt_status()
|
|
|
{
|
|
|
lcd_home();
|
|
@@ -2024,30 +2063,85 @@ static void lcd_menu_test_restore()
|
|
|
}
|
|
|
#endif //RESUME_DEBUG
|
|
|
|
|
|
+//! @brief Show Preheat Menu
|
|
|
static void lcd_preheat_menu()
|
|
|
{
|
|
|
- MENU_BEGIN();
|
|
|
-
|
|
|
- if (!wizard_active) MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
-
|
|
|
- if (farm_mode) {
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), lcd_preheat_farm);
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), lcd_preheat_farm_nozzle);
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown);
|
|
|
- } else {
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)), lcd_preheat_pla);
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)), lcd_preheat_pet);
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)), lcd_preheat_abs);
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)), lcd_preheat_hips);
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)), lcd_preheat_pp);
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)), lcd_preheat_flex);
|
|
|
- if (!wizard_active) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- MENU_END();
|
|
|
+ eFilamentAction = FilamentAction::Preheat;
|
|
|
+ lcd_generic_preheat_menu();
|
|
|
}
|
|
|
|
|
|
+//! @brief Show Support Menu
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! | Main |
|
|
|
+//! | Firmware: | c=18 r=1
|
|
|
+//! | 3.7.2.-2363 | c=16 r=1
|
|
|
+//! | prusa3d.com | MSG_PRUSA3D
|
|
|
+//! | forum.prusa3d.com | MSG_PRUSA3D_FORUM
|
|
|
+//! | howto.prusa3d.com | MSG_PRUSA3D_HOWTO
|
|
|
+//! | -------------- | STR_SEPARATOR
|
|
|
+//! | 1_75mm_MK3 | FILAMENT_SIZE
|
|
|
+//! | howto.prusa3d.com | ELECTRONICS
|
|
|
+//! | howto.prusa3d.com | NOZZLE_TYPE
|
|
|
+//! | -------------- | STR_SEPARATOR
|
|
|
+//! | Date: | c=17 r=1
|
|
|
+//! | MMM DD YYYY | __DATE__
|
|
|
+//! | -------------- | STR_SEPARATOR
|
|
|
+//! @endcode
|
|
|
+//!
|
|
|
+//! If MMU is connected
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! | MMU2 connected | c=18 r=1
|
|
|
+//! | FW: 1.0.6-7064523 |
|
|
|
+//! @endcode
|
|
|
+//!
|
|
|
+//! If MMU is not connected
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! | MMU2 N/A | c=18 r=1
|
|
|
+//! @endcode
|
|
|
+//!
|
|
|
+//! If Flash Air is connected
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! | -------------- | STR_SEPARATOR
|
|
|
+//! | FlashAir IP Addr: | c=18 r=1
|
|
|
+//! | 192.168.1.100 |
|
|
|
+//! @endcode
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! | -------------- | STR_SEPARATOR
|
|
|
+//! | XYZ cal. details | MSG_XYZ_DETAILS
|
|
|
+//! | Extruder info | MSG_INFO_EXTRUDER
|
|
|
+//! | XYZ cal. details | MSG_INFO_SENSORS
|
|
|
+//! @endcode
|
|
|
+//!
|
|
|
+//! If TMC2130 defined
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! | Belt status | MSG_MENU_BELT_STATUS
|
|
|
+//! @endcode
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! | Temperatures | MSG_MENU_TEMPERATURES
|
|
|
+//! @endcode
|
|
|
+//!
|
|
|
+//! If Voltage Bed and PWR Pin are defined
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! | Voltages | MSG_MENU_VOLTAGES
|
|
|
+//! @endcode
|
|
|
+//!
|
|
|
+//!
|
|
|
+//! If DEBUG_BUILD is defined
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! | Debug | c=18 r=1
|
|
|
+//! @endcode
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
static void lcd_support_menu()
|
|
|
{
|
|
|
typedef struct
|
|
@@ -2109,8 +2203,8 @@ static void lcd_support_menu()
|
|
|
MENU_ITEM_BACK_P(STR_SEPARATOR);
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
- MENU_ITEM_BACK_P(_i("MMU2 connected"));
|
|
|
- MENU_ITEM_BACK_P(PSTR(" FW:"));
|
|
|
+ MENU_ITEM_BACK_P(_i("MMU2 connected")); ////c=18 r=1
|
|
|
+ MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 r=1
|
|
|
if (((menu_item - 1) == menu_line) && lcd_draw_update)
|
|
|
{
|
|
|
lcd_set_cursor(6, menu_row);
|
|
@@ -2127,7 +2221,7 @@ static void lcd_support_menu()
|
|
|
// Show the FlashAir IP address, if the card is available.
|
|
|
if (_md->is_flash_air) {
|
|
|
MENU_ITEM_BACK_P(STR_SEPARATOR);
|
|
|
- MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:"));
|
|
|
+ MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); //c=18 r=1
|
|
|
///! MENU_ITEM(back_RAM, _md->ip_str, 0);
|
|
|
}
|
|
|
|
|
@@ -2148,7 +2242,7 @@ static void lcd_support_menu()
|
|
|
#endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN
|
|
|
|
|
|
#ifdef DEBUG_BUILD
|
|
|
- MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////c=18 r=1
|
|
|
#endif /* DEBUG_BUILD */
|
|
|
|
|
|
#endif //MK1BP
|
|
@@ -2198,7 +2292,7 @@ FilamentAction eFilamentAction=FilamentAction::None; // must be initialized as '
|
|
|
bool bFilamentFirstRun;
|
|
|
bool bFilamentPreheatState;
|
|
|
bool bFilamentAction=false;
|
|
|
-bool bFilamentWaitingFlag=false;
|
|
|
+static bool bFilamentWaitingFlag=false;
|
|
|
|
|
|
static void mFilamentPrompt()
|
|
|
{
|
|
@@ -2223,6 +2317,8 @@ switch(eFilamentAction)
|
|
|
case FilamentAction::MmuEject:
|
|
|
case FilamentAction::MmuCut:
|
|
|
case FilamentAction::None:
|
|
|
+ case FilamentAction::Preheat:
|
|
|
+ case FilamentAction::Lay1Cal:
|
|
|
break;
|
|
|
}
|
|
|
if(lcd_clicked())
|
|
@@ -2251,284 +2347,245 @@ if(lcd_clicked())
|
|
|
case FilamentAction::MmuEject:
|
|
|
case FilamentAction::MmuCut:
|
|
|
case FilamentAction::None:
|
|
|
+ case FilamentAction::Preheat:
|
|
|
+ case FilamentAction::Lay1Cal:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
-void _mFilamentItem(uint16_t nTemp,uint16_t nTempBed)
|
|
|
+void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
|
|
|
{
|
|
|
-static int nTargetOld,nTargetBedOld;
|
|
|
-uint8_t nLevel;
|
|
|
-static bool bBeep=false;
|
|
|
-
|
|
|
-//if(bPreheatState) // not necessary
|
|
|
- nTargetOld=target_temperature[0];
|
|
|
- nTargetBedOld=target_temperature_bed;
|
|
|
-setTargetHotend0((float)nTemp);
|
|
|
-setTargetBed((float)nTempBed);
|
|
|
-lcd_timeoutToStatus.stop();
|
|
|
-lcd_set_cursor(0,0);
|
|
|
-lcdui_print_temp(LCD_STR_THERMOMETER[0],(int)degHotend(0),(int)degTargetHotend(0));
|
|
|
-lcd_set_cursor(0,1);
|
|
|
-switch(eFilamentAction)
|
|
|
- {
|
|
|
- case eFILAMENT_ACTION::load:
|
|
|
- case eFILAMENT_ACTION::autoLoad:
|
|
|
- case eFILAMENT_ACTION::mmuLoad:
|
|
|
- lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1
|
|
|
- break;
|
|
|
- case eFILAMENT_ACTION::unLoad:
|
|
|
- case eFILAMENT_ACTION::mmuUnLoad:
|
|
|
- lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
|
|
|
- break;
|
|
|
- case eFILAMENT_ACTION::mmuEject:
|
|
|
- lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
|
|
|
- break;
|
|
|
- case eFILAMENT_ACTION::mmuCut:
|
|
|
- lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
|
|
|
- break;
|
|
|
- }
|
|
|
-lcd_set_cursor(0,3);
|
|
|
-lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1
|
|
|
-if(lcd_clicked())
|
|
|
- {
|
|
|
- if(!bFilamentPreheatState)
|
|
|
- {
|
|
|
- setTargetHotend0(0.0);
|
|
|
- setTargetBed(0.0);
|
|
|
- menu_back();
|
|
|
- }
|
|
|
- else {
|
|
|
- setTargetHotend0((float)nTargetOld);
|
|
|
- setTargetBed((float)nTargetBedOld);
|
|
|
- }
|
|
|
- menu_back();
|
|
|
- if(eFilamentAction==eFILAMENT_ACTION::autoLoad)
|
|
|
- eFilamentAction=eFILAMENT_ACTION::none; // i.e. non-autoLoad
|
|
|
- }
|
|
|
-else {
|
|
|
- if(current_temperature[0]>(target_temperature[0]*0.95))
|
|
|
- {
|
|
|
- switch(eFilamentAction)
|
|
|
- {
|
|
|
- case eFILAMENT_ACTION::load:
|
|
|
- case eFILAMENT_ACTION::autoLoad:
|
|
|
- case eFILAMENT_ACTION::unLoad:
|
|
|
- menu_submenu(mFilamentPrompt);
|
|
|
- break;
|
|
|
- case eFILAMENT_ACTION::mmuLoad:
|
|
|
- nLevel=1;
|
|
|
- if(!bFilamentPreheatState)
|
|
|
- nLevel++;
|
|
|
- bFilamentAction=true;
|
|
|
- menu_back(nLevel);
|
|
|
- menu_submenu(mmu_load_to_nozzle_menu);
|
|
|
- break;
|
|
|
- case eFILAMENT_ACTION::mmuUnLoad:
|
|
|
- nLevel=1;
|
|
|
- if(!bFilamentPreheatState)
|
|
|
- nLevel++;
|
|
|
- bFilamentAction=true;
|
|
|
- menu_back(nLevel);
|
|
|
- extr_unload();
|
|
|
- break;
|
|
|
- case eFILAMENT_ACTION::mmuEject:
|
|
|
- nLevel=1;
|
|
|
- if(!bFilamentPreheatState)
|
|
|
- nLevel++;
|
|
|
- bFilamentAction=true;
|
|
|
- menu_back(nLevel);
|
|
|
- menu_submenu(mmu_fil_eject_menu);
|
|
|
- break;
|
|
|
- case eFILAMENT_ACTION::mmuCut:
|
|
|
- nLevel=1;
|
|
|
- if(!bFilamentPreheatState)
|
|
|
- nLevel++;
|
|
|
- bFilamentAction=true;
|
|
|
- menu_back(nLevel);
|
|
|
- menu_submenu(mmu_cut_filament_menu);
|
|
|
- break;
|
|
|
- }
|
|
|
- if(bBeep)
|
|
|
- Sound_MakeSound(e_SOUND_TYPE_StandardPrompt);
|
|
|
- bBeep=false;
|
|
|
- }
|
|
|
- else bBeep=true;
|
|
|
- }
|
|
|
-}
|
|
|
-*/
|
|
|
+ static int nTargetOld;
|
|
|
+ static int nTargetBedOld;
|
|
|
+ uint8_t nLevel;
|
|
|
|
|
|
-void mFilamentItem(uint16_t nTemp,uint16_t nTempBed)
|
|
|
-{
|
|
|
-static int nTargetOld,nTargetBedOld;
|
|
|
-uint8_t nLevel;
|
|
|
+ nTargetOld = target_temperature[0];
|
|
|
+ nTargetBedOld = target_temperature_bed;
|
|
|
+ setTargetHotend0((float )nTemp);
|
|
|
+ setTargetBed((float) nTempBed);
|
|
|
|
|
|
-//if(bPreheatState) // not necessary
|
|
|
- nTargetOld=target_temperature[0];
|
|
|
- nTargetBedOld=target_temperature_bed;
|
|
|
-setTargetHotend0((float)nTemp);
|
|
|
-setTargetBed((float)nTempBed);
|
|
|
-lcd_timeoutToStatus.stop();
|
|
|
-if(current_temperature[0]>(target_temperature[0]*0.95))
|
|
|
- {
|
|
|
- switch(eFilamentAction)
|
|
|
- {
|
|
|
- case FilamentAction::Load:
|
|
|
- case FilamentAction::AutoLoad:
|
|
|
- case FilamentAction::UnLoad:
|
|
|
- if(bFilamentWaitingFlag)
|
|
|
- menu_submenu(mFilamentPrompt);
|
|
|
- else {
|
|
|
- nLevel=bFilamentPreheatState?1:2;
|
|
|
- menu_back(nLevel);
|
|
|
- if((eFilamentAction==FilamentAction::Load)||(eFilamentAction==FilamentAction::AutoLoad))
|
|
|
- {
|
|
|
- loading_flag=true;
|
|
|
- enquecommand_P(PSTR("M701")); // load filament
|
|
|
- if(eFilamentAction==FilamentAction::AutoLoad)
|
|
|
- eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
|
|
|
- }
|
|
|
- if(eFilamentAction==FilamentAction::UnLoad)
|
|
|
- enquecommand_P(PSTR("M702")); // unload filament
|
|
|
- }
|
|
|
- break;
|
|
|
- case FilamentAction::MmuLoad:
|
|
|
- nLevel=bFilamentPreheatState?1:2;
|
|
|
- bFilamentAction=true;
|
|
|
- menu_back(nLevel);
|
|
|
- menu_submenu(mmu_load_to_nozzle_menu);
|
|
|
- break;
|
|
|
- case FilamentAction::MmuUnLoad:
|
|
|
- nLevel=bFilamentPreheatState?1:2;
|
|
|
- bFilamentAction=true;
|
|
|
- menu_back(nLevel);
|
|
|
- extr_unload();
|
|
|
- break;
|
|
|
- case FilamentAction::MmuEject:
|
|
|
- nLevel=bFilamentPreheatState?1:2;
|
|
|
- bFilamentAction=true;
|
|
|
- menu_back(nLevel);
|
|
|
- menu_submenu(mmu_fil_eject_menu);
|
|
|
- break;
|
|
|
- case FilamentAction::MmuCut:
|
|
|
+ {
|
|
|
+ const FilamentAction action = eFilamentAction;
|
|
|
+ if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal)
|
|
|
+ {
|
|
|
+ lcd_return_to_status();
|
|
|
+ if (action == FilamentAction::Lay1Cal)
|
|
|
+ {
|
|
|
+ lcd_commands_type = LcdCommands::Layer1Cal;
|
|
|
+ }
|
|
|
+ else if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE))
|
|
|
+ {
|
|
|
+ lcd_wizard(WizState::LoadFilHot);
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ lcd_timeoutToStatus.stop();
|
|
|
+
|
|
|
+ if (current_temperature[0] > (target_temperature[0] * 0.95))
|
|
|
+ {
|
|
|
+ switch (eFilamentAction)
|
|
|
+ {
|
|
|
+ case FilamentAction::Load:
|
|
|
+ case FilamentAction::AutoLoad:
|
|
|
+ case FilamentAction::UnLoad:
|
|
|
+ if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt);
|
|
|
+ else
|
|
|
+ {
|
|
|
+ nLevel = bFilamentPreheatState ? 1 : 2;
|
|
|
+ menu_back(nLevel);
|
|
|
+ if ((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad))
|
|
|
+ {
|
|
|
+ loading_flag = true;
|
|
|
+ enquecommand_P(PSTR("M701")); // load filament
|
|
|
+ if (eFilamentAction == FilamentAction::AutoLoad) eFilamentAction = FilamentAction::None; // i.e. non-autoLoad
|
|
|
+ }
|
|
|
+ if (eFilamentAction == FilamentAction::UnLoad)
|
|
|
+ enquecommand_P(PSTR("M702")); // unload filament
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case FilamentAction::MmuLoad:
|
|
|
+ nLevel = bFilamentPreheatState ? 1 : 2;
|
|
|
+ bFilamentAction = true;
|
|
|
+ menu_back(nLevel);
|
|
|
+ menu_submenu(mmu_load_to_nozzle_menu);
|
|
|
+ break;
|
|
|
+ case FilamentAction::MmuUnLoad:
|
|
|
+ nLevel = bFilamentPreheatState ? 1 : 2;
|
|
|
+ bFilamentAction = true;
|
|
|
+ menu_back(nLevel);
|
|
|
+ extr_unload();
|
|
|
+ break;
|
|
|
+ case FilamentAction::MmuEject:
|
|
|
+ nLevel = bFilamentPreheatState ? 1 : 2;
|
|
|
+ bFilamentAction = true;
|
|
|
+ menu_back(nLevel);
|
|
|
+ menu_submenu(mmu_fil_eject_menu);
|
|
|
+ break;
|
|
|
+ case FilamentAction::MmuCut:
|
|
|
#ifdef MMU_HAS_CUTTER
|
|
|
- nLevel=bFilamentPreheatState?1:2;
|
|
|
- bFilamentAction=true;
|
|
|
- menu_back(nLevel);
|
|
|
- menu_submenu(mmu_cut_filament_menu);
|
|
|
+ nLevel=bFilamentPreheatState?1:2;
|
|
|
+ bFilamentAction=true;
|
|
|
+ menu_back(nLevel);
|
|
|
+ menu_submenu(mmu_cut_filament_menu);
|
|
|
#endif //MMU_HAS_CUTTER
|
|
|
- break;
|
|
|
- case FilamentAction::None:
|
|
|
- break;
|
|
|
- }
|
|
|
- if(bFilamentWaitingFlag)
|
|
|
- Sound_MakeSound(e_SOUND_TYPE_StandardPrompt);
|
|
|
- bFilamentWaitingFlag=false;
|
|
|
- }
|
|
|
-else {
|
|
|
- bFilamentWaitingFlag=true;
|
|
|
- lcd_set_cursor(0,0);
|
|
|
- lcdui_print_temp(LCD_STR_THERMOMETER[0],(int)degHotend(0),(int)degTargetHotend(0));
|
|
|
- lcd_set_cursor(0,1);
|
|
|
- switch(eFilamentAction)
|
|
|
- {
|
|
|
- case FilamentAction::Load:
|
|
|
- case FilamentAction::AutoLoad:
|
|
|
- case FilamentAction::MmuLoad:
|
|
|
- lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1
|
|
|
- break;
|
|
|
- case FilamentAction::UnLoad:
|
|
|
- case FilamentAction::MmuUnLoad:
|
|
|
- lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
|
|
|
- break;
|
|
|
- case FilamentAction::MmuEject:
|
|
|
- lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
|
|
|
- break;
|
|
|
- case FilamentAction::MmuCut:
|
|
|
- lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
|
|
|
- break;
|
|
|
- case FilamentAction::None:
|
|
|
- break;
|
|
|
- }
|
|
|
- lcd_set_cursor(0,3);
|
|
|
- lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1
|
|
|
- if(lcd_clicked())
|
|
|
- {
|
|
|
- bFilamentWaitingFlag=false;
|
|
|
- if(!bFilamentPreheatState)
|
|
|
- {
|
|
|
- setTargetHotend0(0.0);
|
|
|
- setTargetBed(0.0);
|
|
|
- menu_back();
|
|
|
- }
|
|
|
- else {
|
|
|
- setTargetHotend0((float)nTargetOld);
|
|
|
- setTargetBed((float)nTargetBedOld);
|
|
|
- }
|
|
|
- menu_back();
|
|
|
- if(eFilamentAction==FilamentAction::AutoLoad)
|
|
|
- eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
|
|
|
- }
|
|
|
- }
|
|
|
+ break;
|
|
|
+ case FilamentAction::None:
|
|
|
+ case FilamentAction::Preheat:
|
|
|
+ case FilamentAction::Lay1Cal:
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (bFilamentWaitingFlag) Sound_MakeSound(e_SOUND_TYPE_StandardPrompt);
|
|
|
+ bFilamentWaitingFlag = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bFilamentWaitingFlag = true;
|
|
|
+ lcd_set_cursor(0, 0);
|
|
|
+ lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0));
|
|
|
+ lcd_set_cursor(0, 1);
|
|
|
+ switch (eFilamentAction)
|
|
|
+ {
|
|
|
+ case FilamentAction::Load:
|
|
|
+ case FilamentAction::AutoLoad:
|
|
|
+ case FilamentAction::MmuLoad:
|
|
|
+ lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1
|
|
|
+ break;
|
|
|
+ case FilamentAction::UnLoad:
|
|
|
+ case FilamentAction::MmuUnLoad:
|
|
|
+ lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
|
|
|
+ break;
|
|
|
+ case FilamentAction::MmuEject:
|
|
|
+ lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
|
|
|
+ break;
|
|
|
+ case FilamentAction::MmuCut:
|
|
|
+ lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
|
|
|
+ break;
|
|
|
+ case FilamentAction::None:
|
|
|
+ case FilamentAction::Preheat:
|
|
|
+ case FilamentAction::Lay1Cal:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ lcd_set_cursor(0, 3);
|
|
|
+ lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1
|
|
|
+ if (lcd_clicked())
|
|
|
+ {
|
|
|
+ bFilamentWaitingFlag = false;
|
|
|
+ if (!bFilamentPreheatState)
|
|
|
+ {
|
|
|
+ setTargetHotend0(0.0);
|
|
|
+ setTargetBed(0.0);
|
|
|
+ menu_back();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ setTargetHotend0((float )nTargetOld);
|
|
|
+ setTargetBed((float) nTargetBedOld);
|
|
|
+ }
|
|
|
+ menu_back();
|
|
|
+ if (eFilamentAction == FilamentAction::AutoLoad) eFilamentAction = FilamentAction::None; // i.e. non-autoLoad
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+static void mFilamentItem_farm()
|
|
|
+{
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, FARM_PREHEAT_HPB_TEMP);
|
|
|
+}
|
|
|
+static void mFilamentItem_farm_nozzle()
|
|
|
+{
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0);
|
|
|
}
|
|
|
|
|
|
static void mFilamentItem_PLA()
|
|
|
{
|
|
|
-bFilamentPreheatState=false;
|
|
|
-mFilamentItem(PLA_PREHEAT_HOTEND_TEMP,PLA_PREHEAT_HPB_TEMP);
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP);
|
|
|
}
|
|
|
|
|
|
static void mFilamentItem_PET()
|
|
|
{
|
|
|
-bFilamentPreheatState=false;
|
|
|
-mFilamentItem(PET_PREHEAT_HOTEND_TEMP,PET_PREHEAT_HPB_TEMP);
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP);
|
|
|
+}
|
|
|
+
|
|
|
+static void mFilamentItem_ASA()
|
|
|
+{
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP);
|
|
|
}
|
|
|
|
|
|
static void mFilamentItem_ABS()
|
|
|
{
|
|
|
-bFilamentPreheatState=false;
|
|
|
-mFilamentItem(ABS_PREHEAT_HOTEND_TEMP,ABS_PREHEAT_HPB_TEMP);
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP);
|
|
|
}
|
|
|
|
|
|
static void mFilamentItem_HIPS()
|
|
|
{
|
|
|
-bFilamentPreheatState=false;
|
|
|
-mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP,HIPS_PREHEAT_HPB_TEMP);
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP);
|
|
|
}
|
|
|
|
|
|
static void mFilamentItem_PP()
|
|
|
{
|
|
|
-bFilamentPreheatState=false;
|
|
|
-mFilamentItem(PP_PREHEAT_HOTEND_TEMP,PP_PREHEAT_HPB_TEMP);
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP);
|
|
|
}
|
|
|
|
|
|
static void mFilamentItem_FLEX()
|
|
|
{
|
|
|
-bFilamentPreheatState=false;
|
|
|
-mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP,FLEX_PREHEAT_HPB_TEMP);
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
void mFilamentBack()
|
|
|
{
|
|
|
-menu_back();
|
|
|
-if(eFilamentAction==FilamentAction::AutoLoad)
|
|
|
- eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
|
|
|
+ menu_back();
|
|
|
+ if (eFilamentAction == FilamentAction::AutoLoad ||
|
|
|
+ eFilamentAction == FilamentAction::Preheat ||
|
|
|
+ eFilamentAction == FilamentAction::Lay1Cal)
|
|
|
+ {
|
|
|
+ eFilamentAction = FilamentAction::None; // i.e. non-autoLoad
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-void mFilamentMenu()
|
|
|
+void lcd_generic_preheat_menu()
|
|
|
{
|
|
|
-MENU_BEGIN();
|
|
|
-MENU_ITEM_FUNCTION_P(_T(MSG_MAIN),mFilamentBack);
|
|
|
-MENU_ITEM_SUBMENU_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)),mFilamentItem_PLA);
|
|
|
-MENU_ITEM_SUBMENU_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)),mFilamentItem_PET);
|
|
|
-MENU_ITEM_SUBMENU_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)),mFilamentItem_ABS);
|
|
|
-MENU_ITEM_SUBMENU_P(PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)),mFilamentItem_HIPS);
|
|
|
-MENU_ITEM_SUBMENU_P(PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)),mFilamentItem_PP);
|
|
|
-MENU_ITEM_SUBMENU_P(PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)),mFilamentItem_FLEX);
|
|
|
-MENU_END();
|
|
|
+ MENU_BEGIN();
|
|
|
+ if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE))
|
|
|
+ {
|
|
|
+ if (eFilamentAction == FilamentAction::Lay1Cal)
|
|
|
+ {
|
|
|
+ MENU_ITEM_FUNCTION_P(_T(MSG_BACK), mFilamentBack);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MENU_ITEM_FUNCTION_P(_T(MSG_MAIN), mFilamentBack);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (farm_mode)
|
|
|
+ {
|
|
|
+ MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm);
|
|
|
+ MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)),mFilamentItem_PLA);
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)),mFilamentItem_PET);
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("ASA - " STRINGIFY(ASA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ASA_PREHEAT_HPB_TEMP)),mFilamentItem_ASA);
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)),mFilamentItem_ABS);
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)),mFilamentItem_HIPS);
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)),mFilamentItem_PP);
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)),mFilamentItem_FLEX);
|
|
|
+ }
|
|
|
+ if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown);
|
|
|
+ MENU_END();
|
|
|
}
|
|
|
|
|
|
void mFilamentItemForce()
|
|
@@ -2539,22 +2596,14 @@ mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
|
|
|
void lcd_unLoadFilament()
|
|
|
{
|
|
|
-//./if((degHotend0()>EXTRUDE_MINTEMP)&&bFilamentFirstRun)
|
|
|
-if(0)
|
|
|
- {
|
|
|
- menu_back();
|
|
|
- enquecommand_P(PSTR("M702")); // unload filament
|
|
|
- }
|
|
|
-else {
|
|
|
eFilamentAction=FilamentAction::UnLoad;
|
|
|
- bFilamentFirstRun=false;
|
|
|
- if(target_temperature[0]>=EXTRUDE_MINTEMP)
|
|
|
- {
|
|
|
- bFilamentPreheatState=true;
|
|
|
- mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
- }
|
|
|
- else mFilamentMenu();
|
|
|
- }
|
|
|
+ preheat_or_continue();
|
|
|
+}
|
|
|
+
|
|
|
+static void mmu_unload_filament()
|
|
|
+{
|
|
|
+ eFilamentAction = FilamentAction::MmuUnLoad;
|
|
|
+ preheat_or_continue();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2770,29 +2819,21 @@ static void lcd_menu_AutoLoadFilament()
|
|
|
}
|
|
|
#endif //FILAMENT_SENSOR
|
|
|
|
|
|
+static void preheat_or_continue()
|
|
|
+{
|
|
|
+ bFilamentFirstRun = false;
|
|
|
+ if (target_temperature[0] >= EXTRUDE_MINTEMP)
|
|
|
+ {
|
|
|
+ bFilamentPreheatState = true;
|
|
|
+ mFilamentItem(target_temperature[0], target_temperature_bed);
|
|
|
+ }
|
|
|
+ else lcd_generic_preheat_menu();
|
|
|
+}
|
|
|
+
|
|
|
static void lcd_LoadFilament()
|
|
|
{
|
|
|
-//-// if (degHotend0() > EXTRUDE_MINTEMP)
|
|
|
-if(0)
|
|
|
- {
|
|
|
-// menu_back(); // not necessary (see "lcd_return_to_status()" below)
|
|
|
- custom_message_type = CustomMsg::FilamentLoading;
|
|
|
- loading_flag = true;
|
|
|
- enquecommand_P(PSTR("M701")); //load filament
|
|
|
- SERIAL_ECHOLN("Loading filament");
|
|
|
- lcd_return_to_status();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- eFilamentAction=FilamentAction::Load;
|
|
|
- bFilamentFirstRun=false;
|
|
|
- if(target_temperature[0]>=EXTRUDE_MINTEMP)
|
|
|
- {
|
|
|
- bFilamentPreheatState=true;
|
|
|
- mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
- }
|
|
|
- else mFilamentMenu();
|
|
|
- }
|
|
|
+ eFilamentAction = FilamentAction::Load;
|
|
|
+ preheat_or_continue();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2802,9 +2843,9 @@ if(0)
|
|
|
//!
|
|
|
//! @code{.unparsed}
|
|
|
//! |01234567890123456789|
|
|
|
-//! |Filament used: |
|
|
|
+//! |Filament used: | c=18 r=1
|
|
|
//! | 00.00m |
|
|
|
-//! |Print time: |
|
|
|
+//! |Print time: | c=18 r=1
|
|
|
//! | 00h 00m 00s |
|
|
|
//! ----------------------
|
|
|
//! @endcode
|
|
@@ -2813,12 +2854,13 @@ if(0)
|
|
|
//!
|
|
|
//! @code{.unparsed}
|
|
|
//! |01234567890123456789|
|
|
|
-//! |Total filament : |
|
|
|
+//! |Total filament : | c=18 r=1
|
|
|
//! | 000.00 m |
|
|
|
-//! |Total print time : |
|
|
|
+//! |Total print time : | c=18 r=1
|
|
|
//! | 00d :00h :00 m |
|
|
|
//! ----------------------
|
|
|
//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations. Translations missing for "d"days, "h"ours, "m"inutes", "s"seconds".
|
|
|
void lcd_menu_statistics()
|
|
|
{
|
|
|
if (IS_SD_PRINTING)
|
|
@@ -2832,10 +2874,12 @@ void lcd_menu_statistics()
|
|
|
lcd_clear();
|
|
|
lcd_printf_P(_N(
|
|
|
"%S:\n"
|
|
|
- "%8.2fm\n"
|
|
|
+ "%17.2fm \n"
|
|
|
"%S:\n"
|
|
|
"%2dh %02dm %02ds"
|
|
|
- ),_i("Filament used"), _met, _i("Print time"), _h, _m, _s);
|
|
|
+ ),
|
|
|
+ _i("Filament used"), _met, ////c=18 r=1
|
|
|
+ _i("Print time"), _h, _m, _s); ////c=18 r=1
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
else
|
|
@@ -2854,7 +2898,7 @@ void lcd_menu_statistics()
|
|
|
lcd_clear();
|
|
|
lcd_printf_P(_N(
|
|
|
"%S:\n"
|
|
|
- "%8.2fm\n"
|
|
|
+ "%17.2fm \n"
|
|
|
"%S:\n"
|
|
|
"%7ldd :%2hhdh :%02hhdm"
|
|
|
), _i("Total filament"), _filament_m, _i("Total print time"), _days, _hours, _minutes);
|
|
@@ -2896,7 +2940,7 @@ static void _lcd_move(const char *name, int axis, int min, int max)
|
|
|
if (max_software_endstops && current_position[axis] > max) current_position[axis] = max;
|
|
|
lcd_encoder = 0;
|
|
|
world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
|
|
- 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);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[axis] / 60, active_extruder);
|
|
|
lcd_draw_update = 1;
|
|
|
}
|
|
|
}
|
|
@@ -2921,7 +2965,7 @@ static void lcd_move_e()
|
|
|
{
|
|
|
current_position[E_AXIS] += float((int)lcd_encoder) * move_menu_scale;
|
|
|
lcd_encoder = 0;
|
|
|
- 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);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60, active_extruder);
|
|
|
lcd_draw_update = 1;
|
|
|
}
|
|
|
}
|
|
@@ -2942,17 +2986,20 @@ static void lcd_move_e()
|
|
|
}
|
|
|
|
|
|
|
|
|
-//@brief Show measured Y distance of front calibration points from Y_MIN_POS
|
|
|
-//If those points are detected too close to edge of reachable area, their confidence is lowered.
|
|
|
-//This functionality is applied more often for MK2 printers.
|
|
|
+//! @brief Show measured Y distance of front calibration points from Y_MIN_POS
|
|
|
+//! If those points are detected too close to edge of reachable area, their confidence is lowered.
|
|
|
+//! This functionality is applied more often for MK2 printers.
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |Y distance from min | c=19 r=1
|
|
|
+//! | -------------- | STR_SEPARATOR
|
|
|
+//! |Left: 00.00mm | c=11 r=1
|
|
|
+//! |Right: 00.00mm | c=11 r=1
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_xyz_y_min()
|
|
|
{
|
|
|
-//|01234567890123456789|
|
|
|
-//|Y distance from min:|
|
|
|
-//|--------------------|
|
|
|
-//|Left: N/A |
|
|
|
-//|Right: N/A |
|
|
|
-//----------------------
|
|
|
float distanceMin[2];
|
|
|
count_xyz_details(distanceMin);
|
|
|
lcd_home();
|
|
@@ -2962,15 +3009,15 @@ static void lcd_menu_xyz_y_min()
|
|
|
"%S:\n"
|
|
|
"%S:"
|
|
|
),
|
|
|
- _i("Y distance from min"),
|
|
|
+ _i("Y distance from min"), ////c=19 r=1
|
|
|
separator,
|
|
|
- _i("Left"),
|
|
|
- _i("Right")
|
|
|
+ _i("Left"), ////c=11 r=1
|
|
|
+ _i("Right") ////c=11 r=1
|
|
|
);
|
|
|
for (uint8_t i = 0; i < 2; i++)
|
|
|
{
|
|
|
lcd_set_cursor(11,2+i);
|
|
|
- if (distanceMin[i] >= 200) lcd_puts_P(_N("N/A"));
|
|
|
+ if (distanceMin[i] >= 200) lcd_puts_P(_N("N/A")); ////c=3 r=1
|
|
|
else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]);
|
|
|
}
|
|
|
if (lcd_clicked())
|
|
@@ -2983,30 +3030,36 @@ float _deg(float rad)
|
|
|
return rad * 180 / M_PI;
|
|
|
}
|
|
|
|
|
|
+//! @brief Show Measured XYZ Skew
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |Measured skew: 0.00D| c=13 r=1
|
|
|
+//! | -------------- | STR_SEPARATOR
|
|
|
+//! |Slight skew: 0.12D| c=13 r=1 c=4 r=1
|
|
|
+//! |Severe skew: 0.25D| c=13 r=1 c=4 r=1
|
|
|
+//! ----------------------
|
|
|
+//! D - Degree sysmbol LCD_STR_DEGREE
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_xyz_skew()
|
|
|
{
|
|
|
-//|01234567890123456789|
|
|
|
-//|Measured skew: N/A |
|
|
|
-//|--------------------|
|
|
|
-//|Slight skew: 0.12d|
|
|
|
-//|Severe skew: 0.25d|
|
|
|
-//----------------------
|
|
|
float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW));
|
|
|
lcd_home();
|
|
|
lcd_printf_P(_N(
|
|
|
"%S:\n"
|
|
|
"%S\n"
|
|
|
- "%S: %5.2f\x01\n"
|
|
|
- "%S: %5.2f\x01"
|
|
|
+ "%-15.15S%3.2f\x01\n"
|
|
|
+ "%-15.15S%3.2f\x01"
|
|
|
),
|
|
|
- _i("Measured skew"),
|
|
|
+ _i("Measured skew"), ////c=13 r=1
|
|
|
separator,
|
|
|
- _i("Slight skew"), _deg(bed_skew_angle_mild),
|
|
|
- _i("Severe skew"), _deg(bed_skew_angle_extreme)
|
|
|
+ _i("Slight skew:"), _deg(bed_skew_angle_mild), ////c=13 r=1 c=4 r=1
|
|
|
+ _i("Severe skew:"), _deg(bed_skew_angle_extreme) ////c=13 r=1 c=4 r=1
|
|
|
);
|
|
|
if (angleDiff < 100){
|
|
|
lcd_set_cursor(15,0);
|
|
|
- lcd_printf_P(_N("%4.2f\x01"), _deg(angleDiff));
|
|
|
+ lcd_printf_P(_N("%3.2f\x01"), _deg(angleDiff));
|
|
|
}
|
|
|
else{
|
|
|
lcd_set_cursor(15,0);
|
|
@@ -3015,16 +3068,24 @@ static void lcd_menu_xyz_skew()
|
|
|
if (lcd_clicked())
|
|
|
menu_goto(lcd_menu_xyz_offset, 0, true, true);
|
|
|
}
|
|
|
-/**
|
|
|
- * @brief Show measured bed offset from expected position
|
|
|
- */
|
|
|
+//! @brief Show measured bed offset from expected position
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |[0;0] point offset | c=20 r=1
|
|
|
+//! | -------------- | STR_SEPARATOR
|
|
|
+//! |X: 000.00mm| c=10 r=1
|
|
|
+//! |Y: 000.00mm| c=10 r=1
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
|
static void lcd_menu_xyz_offset()
|
|
|
{
|
|
|
lcd_set_cursor(0,0);
|
|
|
lcd_puts_P(_i("[0;0] point offset"));////MSG_MEASURED_OFFSET
|
|
|
lcd_puts_at_P(0, 1, separator);
|
|
|
- lcd_puts_at_P(0, 2, PSTR("X"));
|
|
|
- lcd_puts_at_P(0, 3, PSTR("Y"));
|
|
|
+ lcd_puts_at_P(0, 2, PSTR("X")); ////c=10 r=1
|
|
|
+ lcd_puts_at_P(0, 3, PSTR("Y")); ////c=10 r=1
|
|
|
|
|
|
float vec_x[2];
|
|
|
float vec_y[2];
|
|
@@ -3033,9 +3094,9 @@ static void lcd_menu_xyz_offset()
|
|
|
|
|
|
for (uint_least8_t i = 0; i < 2; i++)
|
|
|
{
|
|
|
- lcd_puts_at_P(11, i + 2, PSTR(""));
|
|
|
+ lcd_set_cursor((cntr[i] < 0) ? 10 : 11, i+2);
|
|
|
lcd_print(cntr[i]);
|
|
|
- lcd_puts_at_P((cntr[i] < 0) ? 17 : 16, i + 2, PSTR("mm"));
|
|
|
+ lcd_puts_at_P(16, i + 2, PSTR("mm"));
|
|
|
}
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
@@ -3095,7 +3156,7 @@ static void lcd_babystep_z()
|
|
|
_md->status = 1;
|
|
|
check_babystep();
|
|
|
|
|
|
- if(!is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){
|
|
|
+ if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){
|
|
|
_md->babystepMemZ = 0;
|
|
|
}
|
|
|
else{
|
|
@@ -3146,15 +3207,12 @@ static void lcd_babystep_z()
|
|
|
if (LCD_CLICKED || menu_leaving)
|
|
|
{
|
|
|
// Only update the EEPROM when leaving the menu.
|
|
|
- eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->
|
|
|
- s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),
|
|
|
- _md->babystepMemZ);
|
|
|
- eeprom_update_byte(&(EEPROM_Sheets_base->s[(eeprom_read_byte(
|
|
|
- &(EEPROM_Sheets_base->active_sheet)))].bed_temp),
|
|
|
- target_temperature_bed);
|
|
|
- eeprom_update_byte(&(EEPROM_Sheets_base->s[(eeprom_read_byte(
|
|
|
- &(EEPROM_Sheets_base->active_sheet)))].pinda_temp),
|
|
|
- current_temperature_pinda);
|
|
|
+ uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet));
|
|
|
+ eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[active_sheet].z_offset)),_md->babystepMemZ);
|
|
|
+ eeprom_update_byte(&(EEPROM_Sheets_base->s[active_sheet].bed_temp),target_temperature_bed);
|
|
|
+#ifdef PINDA_THERMISTOR
|
|
|
+ eeprom_update_byte(&(EEPROM_Sheets_base->s[active_sheet].pinda_temp),current_temperature_pinda);
|
|
|
+#endif //PINDA_THERMISTOR
|
|
|
calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
|
|
|
}
|
|
|
if (LCD_CLICKED) menu_back();
|
|
@@ -3183,6 +3241,18 @@ void lcd_adjust_bed_reset(void)
|
|
|
_md->status = 0;
|
|
|
}
|
|
|
|
|
|
+//! @brief Show Bed level correct
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |Settings: | MSG_SETTINGS
|
|
|
+//! |Left side [um]: | MSG_BED_CORRECTION_LEFT
|
|
|
+//! |Right side[um]: | MSG_BED_CORRECTION_RIGHT
|
|
|
+//! |Front side[um]: | MSG_BED_CORRECTION_FRONT
|
|
|
+//! |Rear side [um]: | MSG_BED_CORRECTION_REAR
|
|
|
+//! |Reset | MSG_BED_CORRECTION_RESET
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
void lcd_adjust_bed(void)
|
|
|
{
|
|
|
_menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]);
|
|
@@ -3220,6 +3290,16 @@ void lcd_adjust_bed(void)
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
|
+//! @brief Show PID Extruder
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! | Set temperature: | MSG_SET_TEMPERATURE
|
|
|
+//! | |
|
|
|
+//! | 210 |
|
|
|
+//! | |
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
void pid_extruder()
|
|
|
{
|
|
|
lcd_clear();
|
|
@@ -3323,6 +3403,7 @@ void lcd_adjust_z() {
|
|
|
|
|
|
}*/
|
|
|
|
|
|
+#ifdef PINDA_THERMISTOR
|
|
|
bool lcd_wait_for_pinda(float temp) {
|
|
|
lcd_set_custom_characters_degree();
|
|
|
setAllTargetHotends(0);
|
|
@@ -3351,6 +3432,7 @@ bool lcd_wait_for_pinda(float temp) {
|
|
|
lcd_update_enable(true);
|
|
|
return target_temp_reached;
|
|
|
}
|
|
|
+#endif //PINDA_THERMISTOR
|
|
|
|
|
|
void lcd_wait_for_heater() {
|
|
|
lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING));
|
|
@@ -3367,6 +3449,8 @@ void lcd_wait_for_cool_down() {
|
|
|
lcd_set_custom_characters_degree();
|
|
|
setAllTargetHotends(0);
|
|
|
setTargetBed(0);
|
|
|
+ int fanSpeedBckp = fanSpeed;
|
|
|
+ fanSpeed = 255;
|
|
|
while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) {
|
|
|
lcd_display_message_fullscreen_P(_i("Waiting for nozzle and bed cooling"));////MSG_WAITING_TEMP c=20 r=3
|
|
|
|
|
@@ -3385,6 +3469,7 @@ void lcd_wait_for_cool_down() {
|
|
|
delay_keep_alive(1000);
|
|
|
serialecho_temperatures();
|
|
|
}
|
|
|
+ fanSpeed = fanSpeedBckp;
|
|
|
lcd_set_custom_characters_arrows();
|
|
|
lcd_update_enable(true);
|
|
|
}
|
|
@@ -3420,7 +3505,7 @@ bool lcd_calibrate_z_end_stop_manual(bool only_z)
|
|
|
// Only move up, whatever direction the user rotates the encoder.
|
|
|
current_position[Z_AXIS] += fabs(lcd_encoder);
|
|
|
lcd_encoder = 0;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
}
|
|
|
}
|
|
|
if (lcd_clicked()) {
|
|
@@ -3749,7 +3834,7 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
|
|
lcd_puts_P(PSTR(">"));
|
|
|
lcd_puts_P(_T(MSG_NO));
|
|
|
}
|
|
|
- bool yes = default_yes ? true : false;
|
|
|
+ int8_t retval = default_yes ? true : false;
|
|
|
|
|
|
// Wait for user confirmation or a timeout.
|
|
|
unsigned long previous_millis_cmd = _millis();
|
|
@@ -3758,24 +3843,27 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
for (;;) {
|
|
|
if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS)
|
|
|
- return -1;
|
|
|
+ {
|
|
|
+ retval = -1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
|
if (abs(enc_dif - lcd_encoder_diff) > 4) {
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- if (enc_dif < lcd_encoder_diff && yes) {
|
|
|
+ if (enc_dif < lcd_encoder_diff && retval) {
|
|
|
lcd_puts_P((PSTR(" ")));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P((PSTR(">")));
|
|
|
- yes = false;
|
|
|
+ retval = 0;
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
|
|
|
}
|
|
|
- else if (enc_dif > lcd_encoder_diff && !yes) {
|
|
|
+ else if (enc_dif > lcd_encoder_diff && !retval) {
|
|
|
lcd_puts_P((PSTR(">")));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_puts_P((PSTR(" ")));
|
|
|
- yes = true;
|
|
|
+ retval = 1;
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
}
|
|
|
enc_dif = lcd_encoder_diff;
|
|
@@ -3783,9 +3871,11 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
|
|
if (lcd_clicked()) {
|
|
|
Sound_MakeSound(e_SOUND_TYPE_ButtonEcho);
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
- return yes;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
+ lcd_encoder_diff = 0;
|
|
|
+ return retval;
|
|
|
}
|
|
|
|
|
|
void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask)
|
|
@@ -4440,24 +4530,25 @@ static void lcd_silent_mode_set() {
|
|
|
#endif //TMC2130
|
|
|
st_current_init();
|
|
|
#ifdef TMC2130
|
|
|
- if (CrashDetectMenu && (SilentModeMenu != SILENT_MODE_NORMAL))
|
|
|
+ if (lcd_crash_detect_enabled() && (SilentModeMenu != SILENT_MODE_NORMAL))
|
|
|
menu_submenu(lcd_crash_mode_info2);
|
|
|
lcd_encoder_diff=0; // reset 'encoder buffer'
|
|
|
#endif //TMC2130
|
|
|
}
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
-static void lcd_crash_mode_set()
|
|
|
+static void crash_mode_switch()
|
|
|
{
|
|
|
- CrashDetectMenu = !CrashDetectMenu; //set also from crashdet_enable() and crashdet_disable()
|
|
|
- if (CrashDetectMenu==0) {
|
|
|
- crashdet_disable();
|
|
|
- }else{
|
|
|
- crashdet_enable();
|
|
|
+ if (lcd_crash_detect_enabled())
|
|
|
+ {
|
|
|
+ lcd_crash_detect_disable();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lcd_crash_detect_enable();
|
|
|
}
|
|
|
if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal)) menu_goto(lcd_tune_menu, 9, true, true);
|
|
|
else menu_goto(lcd_settings_menu, 9, true, true);
|
|
|
-
|
|
|
}
|
|
|
#endif //TMC2130
|
|
|
|
|
@@ -4613,7 +4704,7 @@ void lcd_calibrate_pinda() {
|
|
|
|
|
|
lcd_set_cursor(0, 1); lcd_puts_P(_T(MSG_PLEASE_WAIT));
|
|
|
current_position[E_AXIS] += e_shift_calibration;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(feedrate, active_extruder);
|
|
|
st_synchronize();
|
|
|
|
|
|
lcd_display_message_fullscreen_P(msg_e_cal_knob);
|
|
@@ -4636,7 +4727,7 @@ void lcd_calibrate_pinda() {
|
|
|
if (!planner_queue_full()) {
|
|
|
current_position[E_AXIS] += float(abs((int)lcd_encoder)) * 0.01; //0.05
|
|
|
lcd_encoder = 0;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(feedrate, active_extruder);
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -4684,26 +4775,91 @@ void lcd_toshiba_flash_air_compatibility_toggle()
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY, card.ToshibaFlashAir_isEnabled());
|
|
|
}
|
|
|
|
|
|
+//! @brief Continue first layer calibration with previous value or start from zero?
|
|
|
+//!
|
|
|
+//! @code{.unparsed}
|
|
|
+//! |01234567890123456789|
|
|
|
+//! |[Smooth1]Live adj. Z| c=11
|
|
|
+//! |value set, continue | c=20
|
|
|
+//! |or start from zero? | c=20
|
|
|
+//! |>Continue Reset | c=a, c=b, a+b = 18
|
|
|
+//! ----------------------
|
|
|
+//! @endcode
|
|
|
+void lcd_first_layer_calibration_reset()
|
|
|
+{
|
|
|
+ typedef struct
|
|
|
+ {
|
|
|
+ bool reset;
|
|
|
+ } MenuData;
|
|
|
+ static_assert(sizeof(menu_data)>= sizeof(MenuData),"_menu_data_t doesn't fit into menu_data");
|
|
|
+ MenuData* menuData = (MenuData*)&(menu_data[0]);
|
|
|
+
|
|
|
+ if(LCD_CLICKED || !eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) ||
|
|
|
+ (calibration_status() >= CALIBRATION_STATUS_LIVE_ADJUST) ||
|
|
|
+ (0 == static_cast<int16_t>(eeprom_read_word(reinterpret_cast<uint16_t*>
|
|
|
+ (&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)))))
|
|
|
+ {
|
|
|
+ if (menuData->reset)
|
|
|
+ {
|
|
|
+ eeprom_update_word(reinterpret_cast<uint16_t*>(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff);
|
|
|
+ }
|
|
|
+ menu_goto(lcd_v2_calibration,0,true,true);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lcd_encoder > 0)
|
|
|
+ {
|
|
|
+ menuData->reset = true;
|
|
|
+ lcd_encoder = 1;
|
|
|
+ }
|
|
|
+ else if (lcd_encoder < 1)
|
|
|
+ {
|
|
|
+ menuData->reset = false;
|
|
|
+ lcd_encoder = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ char sheet_name[sizeof(Sheet::name)];
|
|
|
+ eeprom_read_block(sheet_name, &EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].name, sizeof(Sheet::name));
|
|
|
+ lcd_set_cursor(0, 0);
|
|
|
+ lcd_printf_P(_i("[%.7s]Live adj. Z\nvalue set, continue\nor start from zero?\n%cContinue%cReset"), //// \n denotes line break, %.7s is replaced by 7 character long sheet name, %+1.3f is replaced by 6 character long floating point number, %c is replaced by > or white space (one character) based on whether first or second option is selected. % denoted place holders can not be reordered. r=4
|
|
|
+ sheet_name, menuData->reset ? ' ' : '>', menuData->reset ? '>' : ' ');
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
void lcd_v2_calibration()
|
|
|
{
|
|
|
- eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), selected_sheet);
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
- const uint8_t filament = choose_menu_P(_i("Select PLA filament:"),_T(MSG_FILAMENT),_i("Cancel")); ////c=20 r=1 ////c=19 r=1
|
|
|
+ const uint8_t filament = choose_menu_P(
|
|
|
+ _i("Select filament:"), ////c=20 r=1
|
|
|
+ _T(MSG_FILAMENT),_i("Cancel")); ////c=19 r=1
|
|
|
if (filament < 5)
|
|
|
{
|
|
|
- lcd_commands_step = 20 + filament;
|
|
|
- lcd_commands_type = LcdCommands::Layer1Cal;
|
|
|
+ lay1cal_filament = filament;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ menu_back();
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+ else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE))
|
|
|
{
|
|
|
- bool loaded = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is PLA filament loaded?"), false, true);////MSG_PLA_FILAMENT_LOADED c=20 r=2
|
|
|
- if (loaded) {
|
|
|
- lcd_commands_type = LcdCommands::Layer1Cal;
|
|
|
- }
|
|
|
- else {
|
|
|
- lcd_display_message_fullscreen_P(_i("Please load PLA filament first."));////MSG_PLEASE_LOAD_PLA c=20 r=4
|
|
|
+ bool loaded = false;
|
|
|
+ if (fsensor_enabled && ir_sensor_detected)
|
|
|
+ {
|
|
|
+ loaded = (digitalRead(IR_SENSOR_PIN) == 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ loaded = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is filament loaded?"), false, true);////MSG_PLA_FILAMENT_LOADED c=20 r=2
|
|
|
+ lcd_update_enabled = true;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (!loaded)
|
|
|
+ {
|
|
|
+ lcd_display_message_fullscreen_P(_i("Please load filament first."));////MSG_PLEASE_LOAD_PLA c=20 r=4
|
|
|
lcd_consume_click();
|
|
|
for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s
|
|
|
delay_keep_alive(100);
|
|
@@ -4711,10 +4867,14 @@ void lcd_v2_calibration()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ lcd_update_enabled = true;
|
|
|
+ menu_back();
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
- lcd_return_to_status();
|
|
|
- lcd_update_enable(true);
|
|
|
+
|
|
|
+ eFilamentAction = FilamentAction::Lay1Cal;
|
|
|
+ menu_goto(lcd_generic_preheat_menu, 0, true, true);
|
|
|
}
|
|
|
|
|
|
void lcd_wizard() {
|
|
@@ -4756,7 +4916,7 @@ void lcd_language()
|
|
|
static void wait_preheat()
|
|
|
{
|
|
|
current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
delay_keep_alive(2000);
|
|
|
lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING));
|
|
|
lcd_set_custom_characters();
|
|
@@ -4771,38 +4931,16 @@ static void wait_preheat()
|
|
|
|
|
|
}
|
|
|
|
|
|
-static void lcd_wizard_unload()
|
|
|
-{
|
|
|
- if(mmu_enabled)
|
|
|
- {
|
|
|
- int8_t unload = lcd_show_multiscreen_message_two_choices_and_wait_P(
|
|
|
- _i("Use unload to remove filament 1 if it protrudes outside of the rear MMU tube. Use eject if it is hidden in tube.")
|
|
|
- ,false, true, _i("Unload"), _i("Eject"));
|
|
|
- if (unload)
|
|
|
- {
|
|
|
- extr_unload_0();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- mmu_eject_filament(0, true);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- unload_filament();
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
static void lcd_wizard_load()
|
|
|
{
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Please insert PLA filament to the first tube of MMU, then press the knob to load it."));////c=20 r=8
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Please insert filament into the first tube of the MMU, then press the knob to load it."));////c=20 r=8
|
|
|
tmp_extruder = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Please insert PLA filament to the extruder, then press knob to load it."));////MSG_WIZARD_LOAD_FILAMENT c=20 r=8
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Please insert filament into the extruder, then press the knob to load it."));////MSG_WIZARD_LOAD_FILAMENT c=20 r=8
|
|
|
}
|
|
|
lcd_update_enable(false);
|
|
|
lcd_clear();
|
|
@@ -4819,6 +4957,24 @@ bool lcd_autoDepleteEnabled()
|
|
|
return (lcd_autoDeplete && fsensor_enabled);
|
|
|
}
|
|
|
|
|
|
+static void wizard_lay1cal_message(bool cold)
|
|
|
+{
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(
|
|
|
+ _i("Now I will calibrate distance between tip of the nozzle and heatbed surface.")); ////MSG_WIZARD_V2_CAL c=20 r=8
|
|
|
+ if (mmu_enabled)
|
|
|
+ {
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(
|
|
|
+ _i("Choose a filament for the First Layer Calibration and select it in the on-screen menu."));
|
|
|
+ }
|
|
|
+ else if (cold)
|
|
|
+ {
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(
|
|
|
+ _i("Select temperature which matches your material."));
|
|
|
+ }
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(
|
|
|
+ _i("The printer will start printing a zig-zag line. Rotate the knob until you reach the optimal height. Check the pictures in the handbook (Calibration chapter).")); ////MSG_WIZARD_V2_CAL_2 c=20 r=12
|
|
|
+}
|
|
|
+
|
|
|
//! @brief Printer first run wizard (Selftest and calibration)
|
|
|
//!
|
|
|
//!
|
|
@@ -4826,18 +4982,26 @@ bool lcd_autoDepleteEnabled()
|
|
|
//!
|
|
|
//! @startuml
|
|
|
//! [*] --> IsFil
|
|
|
-//! IsFil : Is filament 1 loaded?
|
|
|
-//! isPLA : Is filament 1 PLA?
|
|
|
-//! unload : Eject or Unload?
|
|
|
-//! load : Push the button to start loading PLA Filament 1
|
|
|
+//! IsFil : Is any filament loaded?
|
|
|
+//! LoadFilCold : Push the button to start loading Filament 1
|
|
|
+//!
|
|
|
+//! IsFil --> Lay1CalCold : yes
|
|
|
+//! IsFil --> LoadFilCold : no
|
|
|
+//! LoadFilCold --> Lay1CalCold : click
|
|
|
+//! @enduml
|
|
|
+//!
|
|
|
+//! First layer calibration without MMU state diagram
|
|
|
+//!
|
|
|
+//! @startuml
|
|
|
+//! [*] --> IsFil
|
|
|
+//! IsFil : Is filament loaded?
|
|
|
+//! Preheat : Select nozle temperature which matches your material.
|
|
|
+//! LoadFilHot : Insert filament to extruder and press the knob.
|
|
|
//!
|
|
|
-//! IsFil --> isPLA : yes
|
|
|
-//! IsFil --> load : no
|
|
|
-//! isPLA --> unload : no
|
|
|
-//! unload --> load : eject
|
|
|
-//! unload --> load : unload
|
|
|
-//! load --> calibration : click
|
|
|
-//! isPLA --> calibration : yes
|
|
|
+//! IsFil --> Lay1CalCold : yes
|
|
|
+//! IsFil --> Preheat : no
|
|
|
+//! Preheat --> LoadFilHot : select
|
|
|
+//! LoadFilHot --> Lay1CalHot : click
|
|
|
//! @enduml
|
|
|
//!
|
|
|
//! @param state Entry point of the wizard
|
|
@@ -4846,12 +5010,17 @@ bool lcd_autoDepleteEnabled()
|
|
|
//! ---------------------- | ----------------
|
|
|
//! WizState::Run | Main entry point
|
|
|
//! WizState::RepeatLay1Cal | Entry point after passing 1st layer calibration
|
|
|
+//! WizState::LoadFilHot | Entry point after temporarily left for preheat before load filament
|
|
|
void lcd_wizard(WizState state)
|
|
|
{
|
|
|
using S = WizState;
|
|
|
bool end = false;
|
|
|
int wizard_event;
|
|
|
const char *msg = NULL;
|
|
|
+ // Make sure EEPROM_WIZARD_ACTIVE is true if entering using different entry point
|
|
|
+ // other than WizState::Run - it is useful for debugging wizard.
|
|
|
+ if (state != S::Run) eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
|
|
|
+
|
|
|
while (!end) {
|
|
|
printf_P(PSTR("Wizard state: %d\n"), state);
|
|
|
switch (state) {
|
|
@@ -4868,24 +5037,23 @@ void lcd_wizard(WizState state)
|
|
|
// Btw. the flag may even trigger the viper situation on normal start this way and the user won't be able to find out why.
|
|
|
saved_printing = false;
|
|
|
|
|
|
- wizard_active = true;
|
|
|
wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Hi, I am your Original Prusa i3 printer. Would you like me to guide you through the setup process?"), false, true);////MSG_WIZARD_WELCOME c=20 r=7
|
|
|
if (wizard_event) {
|
|
|
state = S::Restore;
|
|
|
- eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
|
|
|
}
|
|
|
else {
|
|
|
- eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0);
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0);
|
|
|
end = true;
|
|
|
}
|
|
|
break;
|
|
|
- case S::Restore: // restore calibration status
|
|
|
+ case S::Restore:
|
|
|
switch (calibration_status()) {
|
|
|
case CALIBRATION_STATUS_ASSEMBLED: state = S::Selftest; break; //run selftest
|
|
|
case CALIBRATION_STATUS_XYZ_CALIBRATION: state = S::Xyz; break; //run xyz cal.
|
|
|
case CALIBRATION_STATUS_Z_CALIBRATION: state = S::Z; break; //run z cal.
|
|
|
case CALIBRATION_STATUS_LIVE_ADJUST: state = S::IsFil; break; //run live adjust
|
|
|
- case CALIBRATION_STATUS_CALIBRATED: end = true; eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0); break;
|
|
|
+ case CALIBRATION_STATUS_CALIBRATED: end = true; eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0); break;
|
|
|
default: state = S::Selftest; break; //if calibration status is unknown, run wizard from the beginning
|
|
|
}
|
|
|
break;
|
|
@@ -4898,13 +5066,13 @@ void lcd_wizard(WizState state)
|
|
|
}
|
|
|
else end = true;
|
|
|
break;
|
|
|
- case S::Xyz: //xyz calibration
|
|
|
+ case S::Xyz:
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("I will run xyz calibration now. It will take approx. 12 mins."));////MSG_WIZARD_XYZ_CAL c=20 r=8
|
|
|
wizard_event = gcode_M45(false, 0);
|
|
|
if (wizard_event) state = S::IsFil;
|
|
|
else end = true;
|
|
|
break;
|
|
|
- case S::Z: //z calibration
|
|
|
+ case S::Z:
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("Please remove shipping helpers first."));
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("Now remove the test print from steel sheet."));
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("I will run z calibration now."));////MSG_WIZARD_Z_CAL c=20 r=8
|
|
@@ -4918,7 +5086,7 @@ void lcd_wizard(WizState state)
|
|
|
lcd_display_message_fullscreen_P(_i("Now I will preheat nozzle for PLA."));
|
|
|
wait_preheat();
|
|
|
//unload current filament
|
|
|
- lcd_wizard_unload();
|
|
|
+ unload_filament();
|
|
|
//load filament
|
|
|
lcd_wizard_load();
|
|
|
setTargetHotend(0, 0); //we are finished, cooldown nozzle
|
|
@@ -4926,69 +5094,63 @@ void lcd_wizard(WizState state)
|
|
|
}
|
|
|
else end = true;
|
|
|
break;
|
|
|
- case S::IsFil: //is filament loaded?
|
|
|
- //start to preheat nozzle and bed to save some time later
|
|
|
+ case S::IsFil:
|
|
|
+ //start to preheat nozzle and bed to save some time later
|
|
|
setTargetHotend(PLA_PREHEAT_HOTEND_TEMP, 0);
|
|
|
setTargetBed(PLA_PREHEAT_HPB_TEMP);
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
- wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is filament 1 loaded?"), false);////c=20 r=2
|
|
|
+ wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is filament loaded?"), true);////c=20 r=2
|
|
|
} else
|
|
|
{
|
|
|
- wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is filament loaded?"), false);////MSG_WIZARD_FILAMENT_LOADED c=20 r=2
|
|
|
+ wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is filament loaded?"), true);////MSG_WIZARD_FILAMENT_LOADED c=20 r=2
|
|
|
}
|
|
|
- if (wizard_event) state = S::IsPla;
|
|
|
+ if (wizard_event) state = S::Lay1CalCold;
|
|
|
else
|
|
|
{
|
|
|
- if(mmu_enabled) state = S::LoadFil;
|
|
|
- else state = S::PreheatPla;
|
|
|
+ if(mmu_enabled) state = S::LoadFilCold;
|
|
|
+ else state = S::Preheat;
|
|
|
}
|
|
|
break;
|
|
|
- case S::PreheatPla:
|
|
|
-#ifndef SNMM
|
|
|
- lcd_display_message_fullscreen_P(_i("Now I will preheat nozzle for PLA."));////MSG_WIZARD_WILL_PREHEAT c=20 r=4
|
|
|
- wait_preheat();
|
|
|
-#endif //not SNMM
|
|
|
- state = S::LoadFil;
|
|
|
- break;
|
|
|
case S::Preheat:
|
|
|
menu_goto(lcd_preheat_menu,0,false,true);
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("Select nozzle preheat temperature which matches your material."));
|
|
|
end = true; // Leave wizard temporarily for lcd_preheat_menu
|
|
|
break;
|
|
|
- case S::Unload:
|
|
|
+ case S::LoadFilHot:
|
|
|
wait_preheat();
|
|
|
- lcd_wizard_unload();
|
|
|
- state = S::LoadFil;
|
|
|
- break;
|
|
|
- case S::LoadFil: //load filament
|
|
|
lcd_wizard_load();
|
|
|
- state = S::Lay1Cal;
|
|
|
- break;
|
|
|
- case S::IsPla:
|
|
|
- wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is it PLA filament?"), false, true);////MSG_WIZARD_PLA_FILAMENT c=20 r=2
|
|
|
- if (wizard_event) state = S::Lay1Cal;
|
|
|
- else state = S::Preheat;
|
|
|
+ state = S::Lay1CalHot;
|
|
|
break;
|
|
|
- case S::Lay1Cal:
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Now I will calibrate distance between tip of the nozzle and heatbed surface."));////MSG_WIZARD_V2_CAL c=20 r=8
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("I will start to print line and you will gradually lower the nozzle by rotating the knob, until you reach optimal height. Check the pictures in our handbook in chapter Calibration."));////MSG_WIZARD_V2_CAL_2 c=20 r=12
|
|
|
- lcd_commands_type = LcdCommands::Layer1Cal;
|
|
|
- lcd_return_to_status();
|
|
|
- end = true;
|
|
|
+ case S::LoadFilCold:
|
|
|
+ lcd_wizard_load();
|
|
|
+ state = S::Lay1CalCold;
|
|
|
+ break;
|
|
|
+ case S::Lay1CalCold:
|
|
|
+ wizard_lay1cal_message(true);
|
|
|
+ menu_goto(lcd_v2_calibration,0,false,true);
|
|
|
+ end = true; // Leave wizard temporarily for lcd_v2_calibration
|
|
|
break;
|
|
|
- case S::RepeatLay1Cal: //repeat first layer cal.?
|
|
|
+ case S::Lay1CalHot:
|
|
|
+ wizard_lay1cal_message(false);
|
|
|
+ lcd_commands_type = LcdCommands::Layer1Cal;
|
|
|
+ end = true; // Leave wizard temporarily for lcd_v2_calibration
|
|
|
+ break;
|
|
|
+ case S::RepeatLay1Cal:
|
|
|
wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_i("Do you want to repeat last step to readjust distance between nozzle and heatbed?"), false);////MSG_WIZARD_REPEAT_V2_CAL c=20 r=7
|
|
|
- if (wizard_event) {
|
|
|
+ if (wizard_event)
|
|
|
+ {
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("Please clean heatbed and then press the knob."));////MSG_WIZARD_CLEAN_HEATBED c=20 r=8
|
|
|
- state = S::Lay1Cal;
|
|
|
+ state = S::Lay1CalCold;
|
|
|
}
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets."));
|
|
|
state = S::Finish;
|
|
|
}
|
|
|
break;
|
|
|
- case S::Finish: //we are finished
|
|
|
- eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0);
|
|
|
+ case S::Finish:
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0);
|
|
|
end = true;
|
|
|
break;
|
|
|
|
|
@@ -5019,9 +5181,9 @@ void lcd_wizard(WizState state)
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
- if (!((S::Lay1Cal == state) || (S::Preheat == state))) {
|
|
|
+ if (!((S::Lay1CalCold == state) || (S::Lay1CalHot == state) || (S::Preheat == state)))
|
|
|
+ {
|
|
|
lcd_show_fullscreen_message_and_wait_P(msg);
|
|
|
- wizard_active = false;
|
|
|
}
|
|
|
lcd_update_enable(true);
|
|
|
lcd_update(2);
|
|
@@ -5171,11 +5333,11 @@ do\
|
|
|
else MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_ON), lcd_silent_mode_set);\
|
|
|
if (SilentModeMenu == SILENT_MODE_NORMAL)\
|
|
|
{\
|
|
|
- if (CrashDetectMenu == 0)\
|
|
|
+ if (lcd_crash_detect_enabled())\
|
|
|
{\
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), lcd_crash_mode_set);\
|
|
|
+ MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), crash_mode_switch);\
|
|
|
}\
|
|
|
- else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), lcd_crash_mode_set);\
|
|
|
+ else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), crash_mode_switch);\
|
|
|
}\
|
|
|
else MENU_ITEM_SUBMENU_P(_T(MSG_CRASHDETECT_NA), lcd_crash_mode_info);\
|
|
|
}\
|
|
@@ -5518,37 +5680,38 @@ SETTINGS_VERSION;
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
|
-void lcd_hw_setup_menu(void) // can not be "static"
|
|
|
+template <uint8_t number>
|
|
|
+static void select_sheet_menu()
|
|
|
{
|
|
|
-MENU_BEGIN();
|
|
|
-MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch
|
|
|
-
|
|
|
-//strncpy(buffer,_i("Sheet"),sizeof(buffer));
|
|
|
-//strncpy(buffer,_i(" "),sizeof(buffer));
|
|
|
-//strncpy(buffer,EEPROM_Sheets_base->s[0].name,sizeof(buffer));
|
|
|
-
|
|
|
-//const char* menu = EEPROM_Sheets_base->s[0].name.c_str();
|
|
|
-
|
|
|
-//const char *b = new char(buffer);
|
|
|
-//const char *b = const char *b = new char(buffer);(buffer);
|
|
|
-//printf_P(_N("UVLO - end %d\n"), _millis() - time_start);
|
|
|
-//SERIAL_ECHOPGM(buffer);
|
|
|
-//SERIAL_ECHOPGM(reinterpret_cast<const char*>(buffer));
|
|
|
-//SERIAL_ECHOPGM("lakdjushasdjaljsdakjsdn");
|
|
|
-//char* p = &buffer[0];
|
|
|
-
|
|
|
-//MENU_ITEM_SUBMENU_P(reinterpret_cast<const char*>(p),lcd_sheet_menu);
|
|
|
+ selected_sheet = number;
|
|
|
+ lcd_sheet_menu();
|
|
|
+}
|
|
|
|
|
|
-//delete(b);
|
|
|
+static void sheets_menu()
|
|
|
+{
|
|
|
+ MENU_BEGIN();
|
|
|
+ MENU_ITEM_BACK_P(_i("HW Setup"));
|
|
|
+ MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>);
|
|
|
+ MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>);
|
|
|
+ MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>);
|
|
|
+ MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>);
|
|
|
+ MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>);
|
|
|
+ MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>);
|
|
|
+ MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>);
|
|
|
+ MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>);
|
|
|
+ MENU_END();
|
|
|
+}
|
|
|
|
|
|
-MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], lcd_select_sheet_0_menu);
|
|
|
-MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], lcd_select_sheet_1_menu);
|
|
|
-MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], lcd_select_sheet_2_menu);
|
|
|
+void lcd_hw_setup_menu(void) // can not be "static"
|
|
|
+{
|
|
|
+ MENU_BEGIN();
|
|
|
+ MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch
|
|
|
|
|
|
-SETTINGS_NOZZLE;
|
|
|
-MENU_ITEM_SUBMENU_P(_i("Checks"), lcd_checking_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Steel sheets"), sheets_menu);
|
|
|
+ SETTINGS_NOZZLE;
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Checks"), lcd_checking_menu);
|
|
|
|
|
|
-MENU_END();
|
|
|
+ MENU_END();
|
|
|
}
|
|
|
|
|
|
static void lcd_settings_menu()
|
|
@@ -5655,7 +5818,10 @@ static void lcd_calibration_menu()
|
|
|
if (!isPrintPaused)
|
|
|
{
|
|
|
MENU_ITEM_FUNCTION_P(_i("Wizard"), lcd_wizard);////MSG_WIZARD c=17 r=1
|
|
|
- MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_v2_calibration);
|
|
|
+ if (lcd_commands_type == LcdCommands::Idle)
|
|
|
+ {
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset);
|
|
|
+ }
|
|
|
MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), PSTR("G28 W"));
|
|
|
MENU_ITEM_FUNCTION_P(_i("Selftest "), lcd_selftest_v);////MSG_SELFTEST
|
|
|
#ifdef MK1BP
|
|
@@ -5901,27 +6067,30 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite
|
|
|
cursor_pos++;
|
|
|
}
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
}
|
|
|
|
|
|
if (cursor_pos > 3)
|
|
|
{
|
|
|
- Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
cursor_pos = 3;
|
|
|
if (first < items_no - 3)
|
|
|
{
|
|
|
first++;
|
|
|
lcd_clear();
|
|
|
+ } else { // here we are at the very end of the list
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (cursor_pos < 1)
|
|
|
{
|
|
|
- Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
cursor_pos = 1;
|
|
|
if (first > 0)
|
|
|
{
|
|
|
first--;
|
|
|
lcd_clear();
|
|
|
+ } else { // here we are at the very end of the list
|
|
|
+ Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -5951,7 +6120,6 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite
|
|
|
lcd_print(" ");
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
lcd_print(">");
|
|
|
- Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
_delay(100);
|
|
|
|
|
|
if (lcd_clicked())
|
|
@@ -6100,13 +6268,7 @@ static void mmu_load_to_nozzle_menu()
|
|
|
else
|
|
|
{
|
|
|
eFilamentAction = FilamentAction::MmuLoad;
|
|
|
- bFilamentFirstRun = false;
|
|
|
- if (target_temperature[0] >= EXTRUDE_MINTEMP)
|
|
|
- {
|
|
|
- bFilamentPreheatState = true;
|
|
|
- mFilamentItem(target_temperature[0], target_temperature_bed);
|
|
|
- }
|
|
|
- else mFilamentMenu();
|
|
|
+ preheat_or_continue();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -6132,13 +6294,7 @@ static void mmu_fil_eject_menu()
|
|
|
else
|
|
|
{
|
|
|
eFilamentAction = FilamentAction::MmuEject;
|
|
|
- bFilamentFirstRun = false;
|
|
|
- if (target_temperature[0] >= EXTRUDE_MINTEMP)
|
|
|
- {
|
|
|
- bFilamentPreheatState = true;
|
|
|
- mFilamentItem(target_temperature[0], target_temperature_bed);
|
|
|
- }
|
|
|
- else mFilamentMenu();
|
|
|
+ preheat_or_continue();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -6166,7 +6322,7 @@ static void mmu_cut_filament_menu()
|
|
|
bFilamentPreheatState=true;
|
|
|
mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
}
|
|
|
- else mFilamentMenu();
|
|
|
+ else lcd_generic_preheat_menu();
|
|
|
}
|
|
|
}
|
|
|
#endif //MMU_HAS_CUTTER
|
|
@@ -6210,13 +6366,13 @@ void unload_filament()
|
|
|
// extr_unload2();
|
|
|
|
|
|
current_position[E_AXIS] -= 45;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 5200 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(5200 / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
current_position[E_AXIS] -= 15;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 1000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(1000 / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
current_position[E_AXIS] -= 20;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 1000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(1000 / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
|
|
|
lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT));
|
|
@@ -6486,19 +6642,61 @@ static void lcd_test_menu()
|
|
|
}
|
|
|
#endif //LCD_TEST
|
|
|
|
|
|
+static bool fan_error_selftest()
|
|
|
+{
|
|
|
+#ifdef FANCHECK
|
|
|
+
|
|
|
+ fanSpeed = 255;
|
|
|
+#ifdef FAN_SOFT_PWM
|
|
|
+ fanSpeedSoftPwm = 255;
|
|
|
+#endif //FAN_SOFT_PWM
|
|
|
+ manage_heater(); //enables print fan
|
|
|
+ setExtruderAutoFanState(EXTRUDER_0_AUTO_FAN_PIN, 1); //force enables the extruder fan untill the first manage_heater() call.
|
|
|
+#ifdef FAN_SOFT_PWM
|
|
|
+ extruder_autofan_last_check = _millis();
|
|
|
+ fan_measuring = true;
|
|
|
+#endif //FAN_SOFT_PWM
|
|
|
+ _delay(1000); //delay_keep_alive would turn off extruder fan, because temerature is too low (maybe)
|
|
|
+ manage_heater();
|
|
|
+ fanSpeed = 0;
|
|
|
+#ifdef FAN_SOFT_PWM
|
|
|
+ fanSpeedSoftPwm = 0;
|
|
|
+#endif //FAN_SOFT_PWM
|
|
|
+ manage_heater();
|
|
|
+#ifdef TACH_0
|
|
|
+ if (fan_speed[0] <= 20) { //extruder fan error
|
|
|
+ LCD_ALERTMESSAGERPGM(MSG_FANCHECK_EXTRUDER);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+#ifdef TACH_1
|
|
|
+ if (fan_speed[1] <= 20) { //print fan error
|
|
|
+ LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+ return 0;
|
|
|
+
|
|
|
+#endif //FANCHECK
|
|
|
+}
|
|
|
+
|
|
|
//! @brief Resume paused print
|
|
|
//! @todo It is not good to call restore_print_from_ram_and_continue() from function called by lcd_update(),
|
|
|
//! as restore_print_from_ram_and_continue() calls lcd_update() internally.
|
|
|
void lcd_resume_print()
|
|
|
{
|
|
|
lcd_return_to_status();
|
|
|
- lcd_reset_alert_level();
|
|
|
+ lcd_reset_alert_level();
|
|
|
lcd_setstatuspgm(_T(MSG_RESUMING_PRINT));
|
|
|
lcd_reset_alert_level(); //for fan speed error
|
|
|
+
|
|
|
+ if (fan_error_selftest()) return; //abort if error persists
|
|
|
+
|
|
|
restore_print_from_ram_and_continue(0.0);
|
|
|
pause_time += (_millis() - start_pause_print); //accumulate time when print is paused for correct statistics calculation
|
|
|
refresh_cmd_timeout();
|
|
|
isPrintPaused = false;
|
|
|
+ SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUMED); //resume octoprint
|
|
|
}
|
|
|
|
|
|
static void change_sheet()
|
|
@@ -6507,40 +6705,7 @@ static void change_sheet()
|
|
|
menu_back(3);
|
|
|
}
|
|
|
|
|
|
-static void change_sheet_from_menu(){
|
|
|
- uint8_t next_sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))+1;
|
|
|
- while(true){
|
|
|
- if(next_sheet > 2) next_sheet = 0;
|
|
|
- if(is_sheet_initialized(next_sheet)){
|
|
|
- eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), next_sheet);
|
|
|
- selected_sheet = next_sheet;
|
|
|
- break;
|
|
|
- }
|
|
|
- else if (next_sheet == selected_sheet){
|
|
|
- break;
|
|
|
- }
|
|
|
- else{
|
|
|
- next_sheet++;
|
|
|
- }
|
|
|
- }
|
|
|
- menu_back();
|
|
|
-}
|
|
|
|
|
|
-static void lcd_select_sheet_0_menu()
|
|
|
-{
|
|
|
- selected_sheet = 0;
|
|
|
- lcd_sheet_menu();
|
|
|
-}
|
|
|
-static void lcd_select_sheet_1_menu()
|
|
|
-{
|
|
|
- selected_sheet = 1;
|
|
|
- lcd_sheet_menu();
|
|
|
-}
|
|
|
-static void lcd_select_sheet_2_menu()
|
|
|
-{
|
|
|
- selected_sheet = 2;
|
|
|
- lcd_sheet_menu();
|
|
|
-}
|
|
|
|
|
|
static void lcd_rename_sheet_menu()
|
|
|
{
|
|
@@ -6588,37 +6753,44 @@ static void lcd_rename_sheet_menu()
|
|
|
|
|
|
static void lcd_reset_sheet()
|
|
|
{
|
|
|
- struct MenuData
|
|
|
- {
|
|
|
- bool initialized;
|
|
|
- uint8_t selected;
|
|
|
- char name[sizeof(Sheet::name)];
|
|
|
- };
|
|
|
- static_assert(sizeof(menu_data)>= sizeof(MenuData),"MenuData doesn't fit into menu_data");
|
|
|
- MenuData* menuData = (MenuData*)&(menu_data[0]);
|
|
|
- eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name));
|
|
|
-
|
|
|
- menuData->initialized = false;
|
|
|
- strcpy_P(menuData->name, (char *)pgm_read_word(&(defaultSheetNames[selected_sheet])));
|
|
|
+ SheetName sheetName;
|
|
|
+ eeprom_default_sheet_name(selected_sheet, sheetName);
|
|
|
+ eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16);
|
|
|
+ eeprom_update_block(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name));
|
|
|
+ if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))
|
|
|
+ {
|
|
|
+ eeprom_switch_to_next_sheet();
|
|
|
+ if((-1 == eeprom_next_initialized_sheet(0)) && (CALIBRATION_STATUS_CALIBRATED == calibration_status()))
|
|
|
+ {
|
|
|
+ calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ menu_back();
|
|
|
+}
|
|
|
|
|
|
- eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),0xffff);
|
|
|
- eeprom_update_block(menuData->name,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name));
|
|
|
- menu_back(2);
|
|
|
+//! @brief Activate selected_sheet and run first layer calibration
|
|
|
+static void activate_calibrate_sheet()
|
|
|
+{
|
|
|
+ eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), selected_sheet);
|
|
|
+ lcd_first_layer_calibration_reset();
|
|
|
}
|
|
|
|
|
|
static void lcd_sheet_menu()
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
- MENU_ITEM_BACK_P(_T(MSG_HW_SETUP));
|
|
|
+ MENU_ITEM_BACK_P(_i("Steel sheets"));
|
|
|
|
|
|
- if(is_sheet_initialized(selected_sheet)){
|
|
|
+ if(eeprom_is_sheet_initialized(selected_sheet)){
|
|
|
MENU_ITEM_SUBMENU_P(_i("Select"), change_sheet); //// c=18
|
|
|
}
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_v2_calibration);
|
|
|
+ if (lcd_commands_type == LcdCommands::Idle)
|
|
|
+ {
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet);
|
|
|
+ }
|
|
|
MENU_ITEM_SUBMENU_P(_i("Rename"), lcd_rename_sheet_menu); //// c=18
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Reset"), lcd_reset_sheet); //// c=18
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Reset"), lcd_reset_sheet); //// c=18
|
|
|
|
|
|
MENU_END();
|
|
|
}
|
|
@@ -6660,6 +6832,10 @@ static void lcd_main_menu()
|
|
|
}
|
|
|
|
|
|
|
|
|
+#ifdef FANCHECK
|
|
|
+ if((fan_check_error == EFCE_FIXED) && (saved_printing_type == PRINTING_TYPE_USB))
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
|
|
|
+#endif
|
|
|
|
|
|
#ifdef SDSUPPORT
|
|
|
if (card.cardOK || lcd_commands_type == LcdCommands::Layer1Cal)
|
|
@@ -6674,9 +6850,8 @@ static void lcd_main_menu()
|
|
|
else
|
|
|
{
|
|
|
#ifdef FANCHECK
|
|
|
- checkFanSpeed(); //Check manually to get most recent fan speed status
|
|
|
- if(fan_check_error == EFCE_OK)
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
|
|
|
+ if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK))
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
|
|
|
#else
|
|
|
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
|
|
|
#endif
|
|
@@ -6713,6 +6888,19 @@ static void lcd_main_menu()
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
+ if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal))
|
|
|
+ {
|
|
|
+ if (!farm_mode)
|
|
|
+ {
|
|
|
+ const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet));
|
|
|
+ const int8_t nextSheet = eeprom_next_initialized_sheet(sheet);
|
|
|
+ if ((nextSheet >= 0) && (sheet != nextSheet)) // show menu only if we have 2 or more sheets initialized
|
|
|
+ {
|
|
|
+ MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal))
|
|
|
{
|
|
@@ -6729,7 +6917,7 @@ static void lcd_main_menu()
|
|
|
MENU_ITEM_SUBMENU_P(_i("Load to nozzle"), mmu_load_to_nozzle_menu);
|
|
|
//-// MENU_ITEM_FUNCTION_P(_T(MSG_UNLOAD_FILAMENT), extr_unload);
|
|
|
//bFilamentFirstRun=true;
|
|
|
- MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), extr_unload_);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), mmu_unload_filament);
|
|
|
MENU_ITEM_SUBMENU_P(_i("Eject filament"), mmu_fil_eject_menu);
|
|
|
#ifdef MMU_HAS_CUTTER
|
|
|
MENU_ITEM_SUBMENU_P(_i("Cut filament"), mmu_cut_filament_menu);
|
|
@@ -6757,14 +6945,6 @@ static void lcd_main_menu()
|
|
|
if(!isPrintPaused) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_CALIBRATION), lcd_calibration_menu);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- if(!isPrintPaused && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal))
|
|
|
- {
|
|
|
- if (!farm_mode)
|
|
|
- {
|
|
|
- MENU_ITEM_SUBMENU_SELECT_SHEET_E(EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))], change_sheet_from_menu);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
if (!is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal))
|
|
|
{
|
|
@@ -6895,8 +7075,8 @@ static void lcd_tune_menu()
|
|
|
|
|
|
if (SilentModeMenu == SILENT_MODE_NORMAL)
|
|
|
{
|
|
|
- if (CrashDetectMenu == 0) MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), lcd_crash_mode_set);
|
|
|
- else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), lcd_crash_mode_set);
|
|
|
+ if (lcd_crash_detect_enabled()) MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), crash_mode_switch);
|
|
|
+ else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), crash_mode_switch);
|
|
|
}
|
|
|
else MENU_ITEM_SUBMENU_P(_T(MSG_CRASHDETECT_NA), lcd_crash_mode_info);
|
|
|
}
|
|
@@ -7033,9 +7213,10 @@ void lcd_print_stop()
|
|
|
//-//
|
|
|
if(!card.sdprinting)
|
|
|
{
|
|
|
- SERIAL_ECHOLNPGM("// action:cancel"); // for Octoprint
|
|
|
+ SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL); // for Octoprint
|
|
|
}
|
|
|
saved_printing = false;
|
|
|
+ saved_printing_type = PRINTING_TYPE_NONE;
|
|
|
cancel_heatup = true;
|
|
|
#ifdef MESH_BED_LEVELING
|
|
|
mbl.active = false;
|
|
@@ -7300,7 +7481,7 @@ bool lcd_selftest()
|
|
|
//homeaxis(X_AXIS);
|
|
|
//homeaxis(Y_AXIS);
|
|
|
current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
_progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500);
|
|
|
_result = lcd_selfcheck_axis(2, Z_MAX_POS);
|
|
@@ -7314,7 +7495,7 @@ bool lcd_selftest()
|
|
|
if (_result)
|
|
|
{
|
|
|
current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
_progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0);
|
|
|
bool bres = tmc2130_home_calibrate(X_AXIS);
|
|
@@ -7398,7 +7579,7 @@ bool lcd_selftest()
|
|
|
|
|
|
static void reset_crash_det(unsigned char axis) {
|
|
|
current_position[axis] += 10;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET)) tmc2130_sg_stop_on_crash = true;
|
|
|
}
|
|
@@ -7422,7 +7603,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
if (axis == X_AXIS) { //there is collision between cables and PSU cover in X axis if Z coordinate is too low
|
|
|
|
|
|
current_position[Z_AXIS] += 17;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
tmc2130_home_enter(Z_AXIS_MASK);
|
|
|
st_synchronize();
|
|
|
tmc2130_home_exit();
|
|
@@ -7431,7 +7612,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
// first axis length measurement begin
|
|
|
|
|
|
current_position[axis] -= (axis_length + margin);
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
|
|
|
|
|
|
st_synchronize();
|
|
@@ -7441,11 +7622,11 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
current_position_init = st_get_position_mm(axis);
|
|
|
|
|
|
current_position[axis] += 2 * margin;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
|
|
|
current_position[axis] += axis_length;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
|
|
|
st_synchronize();
|
|
|
|
|
@@ -7461,11 +7642,11 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
|
|
|
|
|
|
current_position[axis] -= margin;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
|
|
|
current_position[axis] -= (axis_length + margin);
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
|
|
|
st_synchronize();
|
|
|
|
|
@@ -7534,13 +7715,13 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
|
|
|
if (_axis == X_AXIS) {
|
|
|
current_position[Z_AXIS] += 17;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
}
|
|
|
|
|
|
do {
|
|
|
current_position[_axis] = current_position[_axis] - 1;
|
|
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
#ifdef TMC2130
|
|
|
if ((READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING))
|
|
@@ -7594,7 +7775,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
|
|
|
|
|
|
//current_position[_axis] = current_position[_axis] + 15;
|
|
|
- //plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ //plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
|
|
|
if (!_stepresult)
|
|
|
{
|
|
@@ -7642,17 +7823,17 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
current_position_init = current_position[axis];
|
|
|
|
|
|
current_position[axis] += 2;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
for (i = 0; i < 5; i++) {
|
|
|
refresh_cmd_timeout();
|
|
|
current_position[axis] = current_position[axis] + move;
|
|
|
st_current_set(0, 850); //set motor current higher
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 200, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(200, active_extruder);
|
|
|
st_synchronize();
|
|
|
if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents
|
|
|
else st_current_set(0, tmp_motor_loud[0]); //set motor current back
|
|
|
current_position[axis] = current_position[axis] - move;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(50, active_extruder);
|
|
|
st_synchronize();
|
|
|
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
|
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
|
|
@@ -7669,7 +7850,7 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
endstop_triggered = true;
|
|
|
if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) {
|
|
|
current_position[axis] += (axis == X_AXIS) ? 13 : 9;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
return(true);
|
|
|
}
|
|
@@ -7680,7 +7861,7 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
}
|
|
|
else {
|
|
|
current_position[axis] -= 1;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
st_synchronize();
|
|
|
if (_millis() > timeout_counter) {
|
|
|
lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
|
|
@@ -7704,7 +7885,7 @@ static bool lcd_selfcheck_endstops()
|
|
|
if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10;
|
|
|
if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10;
|
|
|
}
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
_delay(500);
|
|
|
|
|
|
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
@@ -8538,11 +8719,52 @@ uint8_t get_message_level()
|
|
|
return lcd_status_message_level;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
void menu_lcd_longpress_func(void)
|
|
|
{
|
|
|
- move_menu_scale = 1.0;
|
|
|
- menu_submenu(lcd_move_z);
|
|
|
+ if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z)
|
|
|
+ {
|
|
|
+ // disable longpress during re-entry, while homing or calibration
|
|
|
+ lcd_quick_feedback();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // explicitely listed menus which are allowed to rise the move-z or live-adj-z functions
|
|
|
+ // The lists are not the same for both functions, so first decide which function is to be performed
|
|
|
+ if ( (moves_planned() || IS_SD_PRINTING || is_usb_printing )){ // long press as live-adj-z
|
|
|
+ if(( current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU ) // only allow live-adj-z up to 2mm of print height
|
|
|
+ && ( menu_menu == lcd_status_screen // and in listed menus...
|
|
|
+ || menu_menu == lcd_main_menu
|
|
|
+ || menu_menu == lcd_tune_menu
|
|
|
+ || menu_menu == lcd_support_menu
|
|
|
+ )
|
|
|
+ ){
|
|
|
+ lcd_clear();
|
|
|
+ menu_submenu(lcd_babystep_z);
|
|
|
+ } else {
|
|
|
+ // otherwise consume the long press as normal click
|
|
|
+ if( menu_menu != lcd_status_screen )
|
|
|
+ menu_back();
|
|
|
+ }
|
|
|
+ } else { // long press as move-z
|
|
|
+ if(menu_menu == lcd_status_screen
|
|
|
+ || menu_menu == lcd_main_menu
|
|
|
+ || menu_menu == lcd_preheat_menu
|
|
|
+ || menu_menu == lcd_sdcard_menu
|
|
|
+ || menu_menu == lcd_settings_menu
|
|
|
+ || menu_menu == lcd_control_temperature_menu
|
|
|
+#if (LANG_MODE != 0)
|
|
|
+ || menu_menu == lcd_language
|
|
|
+#endif
|
|
|
+ || menu_menu == lcd_support_menu
|
|
|
+ ){
|
|
|
+ move_menu_scale = 1.0;
|
|
|
+ menu_submenu(lcd_move_z);
|
|
|
+ } else {
|
|
|
+ // otherwise consume the long press as normal click
|
|
|
+ if( menu_menu != lcd_status_screen )
|
|
|
+ menu_back();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void menu_lcd_charsetup_func(void)
|
|
@@ -8637,3 +8859,27 @@ void menu_lcd_lcdupdate_func(void)
|
|
|
lcd_send_status();
|
|
|
if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands();
|
|
|
}
|
|
|
+
|
|
|
+#ifdef TMC2130
|
|
|
+//! @brief Is crash detection enabled?
|
|
|
+//!
|
|
|
+//! @retval true crash detection enabled
|
|
|
+//! @retval false crash detection disabled
|
|
|
+bool lcd_crash_detect_enabled()
|
|
|
+{
|
|
|
+ return eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET);
|
|
|
+}
|
|
|
+
|
|
|
+void lcd_crash_detect_enable()
|
|
|
+{
|
|
|
+ tmc2130_sg_stop_on_crash = true;
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_CRASH_DET, 0xFF);
|
|
|
+}
|
|
|
+
|
|
|
+void lcd_crash_detect_disable()
|
|
|
+{
|
|
|
+ tmc2130_sg_stop_on_crash = false;
|
|
|
+ tmc2130_sg_crash = 0;
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_CRASH_DET, 0x00);
|
|
|
+}
|
|
|
+#endif
|