|
@@ -228,10 +228,6 @@ bool fan_state[2];
|
|
|
int fan_edge_counter[2];
|
|
|
int fan_speed[2];
|
|
|
|
|
|
-char dir_names[MAX_DIR_DEPTH][9];
|
|
|
-
|
|
|
-bool sortAlpha = false;
|
|
|
-
|
|
|
|
|
|
float extruder_multiplier[EXTRUDERS] = {1.0
|
|
|
#if EXTRUDERS > 1
|
|
@@ -320,6 +316,8 @@ uint8_t print_percent_done_normal = PRINT_PERCENT_DONE_INIT;
|
|
|
uint16_t print_time_remaining_normal = PRINT_TIME_REMAINING_INIT;
|
|
|
uint8_t print_percent_done_silent = PRINT_PERCENT_DONE_INIT;
|
|
|
uint16_t print_time_remaining_silent = PRINT_TIME_REMAINING_INIT;
|
|
|
+uint16_t print_time_to_change_normal = PRINT_TIME_REMAINING_INIT;
|
|
|
+uint16_t print_time_to_change_silent = PRINT_TIME_REMAINING_INIT;
|
|
|
|
|
|
uint32_t IP_address = 0;
|
|
|
|
|
@@ -711,124 +709,98 @@ void softReset()
|
|
|
#endif
|
|
|
|
|
|
|
|
|
+static void factory_reset_stats(){
|
|
|
+ eeprom_update_dword((uint32_t *)EEPROM_TOTALTIME, 0);
|
|
|
+ eeprom_update_dword((uint32_t *)EEPROM_FILAMENTUSED, 0);
|
|
|
+
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_X, 0);
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_Y, 0);
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_FERROR_COUNT, 0);
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_POWER_COUNT, 0);
|
|
|
+
|
|
|
+ eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_X_TOT, 0);
|
|
|
+ eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_Y_TOT, 0);
|
|
|
+ eeprom_update_word((uint16_t *)EEPROM_FERROR_COUNT_TOT, 0);
|
|
|
+ eeprom_update_word((uint16_t *)EEPROM_POWER_COUNT_TOT, 0);
|
|
|
+
|
|
|
+ eeprom_update_word((uint16_t *)EEPROM_MMU_FAIL_TOT, 0);
|
|
|
+ eeprom_update_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT, 0);
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_MMU_FAIL, 0);
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL, 0);
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
-int er_progress = 0;
|
|
|
static void factory_reset(char level)
|
|
|
-{
|
|
|
+{
|
|
|
lcd_clear();
|
|
|
- switch (level) {
|
|
|
-
|
|
|
-
|
|
|
- case 0:
|
|
|
- Sound_MakeCustom(100,0,false);
|
|
|
- lang_reset();
|
|
|
- break;
|
|
|
-
|
|
|
-
|
|
|
- case 1:
|
|
|
- Sound_MakeCustom(100,0,false);
|
|
|
- eeprom_update_dword((uint32_t *)EEPROM_TOTALTIME, 0);
|
|
|
- eeprom_update_dword((uint32_t *)EEPROM_FILAMENTUSED, 0);
|
|
|
-
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_X, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_Y, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_FERROR_COUNT, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_POWER_COUNT, 0);
|
|
|
-
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_X_TOT, 0);
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_Y_TOT, 0);
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_FERROR_COUNT_TOT, 0);
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_POWER_COUNT_TOT, 0);
|
|
|
-
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_MMU_FAIL_TOT, 0);
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_MMU_FAIL, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL, 0);
|
|
|
-
|
|
|
-
|
|
|
- lcd_menu_statistics();
|
|
|
-
|
|
|
- break;
|
|
|
+ Sound_MakeCustom(100,0,false);
|
|
|
+ switch (level) {
|
|
|
|
|
|
-
|
|
|
- case 2:
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- lang_reset();
|
|
|
-
|
|
|
- calibration_status_store(CALIBRATION_STATUS_Z_CALIBRATION);
|
|
|
- eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
|
|
|
- farm_mode = false;
|
|
|
- eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode);
|
|
|
-
|
|
|
- eeprom_update_dword((uint32_t *)EEPROM_TOTALTIME, 0);
|
|
|
- eeprom_update_dword((uint32_t *)EEPROM_FILAMENTUSED, 0);
|
|
|
-
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_X, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_Y, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_FERROR_COUNT, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_POWER_COUNT, 0);
|
|
|
-
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_X_TOT, 0);
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_CRASH_COUNT_Y_TOT, 0);
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_FERROR_COUNT_TOT, 0);
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_POWER_COUNT_TOT, 0);
|
|
|
-
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_MMU_FAIL_TOT, 0);
|
|
|
- eeprom_update_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_MMU_FAIL, 0);
|
|
|
- eeprom_update_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL, 0);
|
|
|
+ case 0:
|
|
|
+ lang_reset();
|
|
|
+ break;
|
|
|
|
|
|
-#ifdef FILAMENT_SENSOR
|
|
|
- fsensor_enable();
|
|
|
- fsensor_autoload_set(true);
|
|
|
-#endif
|
|
|
- Sound_MakeCustom(100,0,false);
|
|
|
-
|
|
|
- break;
|
|
|
+ case 1:
|
|
|
+ factory_reset_stats();
|
|
|
+ lcd_menu_statistics();
|
|
|
+ break;
|
|
|
|
|
|
-
|
|
|
+ case 2:
|
|
|
+ factory_reset_stats();
|
|
|
+
|
|
|
|
|
|
- case 3:
|
|
|
- lcd_puts_P(PSTR("Factory RESET"));
|
|
|
- lcd_puts_at_P(1, 2, PSTR("ERASING all data"));
|
|
|
-
|
|
|
- Sound_MakeCustom(100,0,false);
|
|
|
- er_progress = 0;
|
|
|
- lcd_puts_at_P(3, 3, PSTR(" "));
|
|
|
- lcd_set_cursor(3, 3);
|
|
|
- lcd_print(er_progress);
|
|
|
-
|
|
|
-
|
|
|
- for (int i = 0; i < 4096; i++) {
|
|
|
- eeprom_update_byte((uint8_t*)i, 0xFF);
|
|
|
-
|
|
|
- if (i % 41 == 0) {
|
|
|
- er_progress++;
|
|
|
- lcd_puts_at_P(3, 3, PSTR(" "));
|
|
|
- lcd_set_cursor(3, 3);
|
|
|
- lcd_print(er_progress);
|
|
|
- lcd_puts_P(PSTR("%"));
|
|
|
- }
|
|
|
+ case 4:
|
|
|
+
|
|
|
+ lang_reset();
|
|
|
+
|
|
|
+ calibration_status_store(CALIBRATION_STATUS_Z_CALIBRATION);
|
|
|
+ eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
|
|
|
+ farm_mode = false;
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode);
|
|
|
+
|
|
|
+#ifdef FILAMENT_SENSOR
|
|
|
+ fsensor_enable();
|
|
|
+ fsensor_autoload_set(true);
|
|
|
+#endif
|
|
|
+ break;
|
|
|
|
|
|
+ case 3:{
|
|
|
+ lcd_puts_P(PSTR("Factory RESET"));
|
|
|
+ lcd_puts_at_P(1, 2, PSTR("ERASING all data"));
|
|
|
+ uint16_t er_progress = 0;
|
|
|
+ lcd_set_cursor(3, 3);
|
|
|
+ lcd_space(6);
|
|
|
+ lcd_set_cursor(3, 3);
|
|
|
+ lcd_print(er_progress);
|
|
|
+
|
|
|
+
|
|
|
+ for (uint16_t i = 0; i < 4096; i++) {
|
|
|
+ eeprom_update_byte((uint8_t*)i, 0xFF);
|
|
|
+
|
|
|
+ if (i % 41 == 0) {
|
|
|
+ er_progress++;
|
|
|
+ lcd_set_cursor(3, 3);
|
|
|
+ lcd_space(6);
|
|
|
+ lcd_set_cursor(3, 3);
|
|
|
+ lcd_print(er_progress);
|
|
|
+ lcd_puts_P(PSTR("%"));
|
|
|
}
|
|
|
- softReset();
|
|
|
|
|
|
+ }
|
|
|
+ softReset();
|
|
|
+ }break;
|
|
|
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- bowden_menu();
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+#ifdef SNMM
|
|
|
+ case 5:
|
|
|
+ bowden_menu();
|
|
|
+ break;
|
|
|
+#endif
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
extern "C" {
|
|
@@ -859,30 +831,27 @@ void factory_reset()
|
|
|
{
|
|
|
lcd_clear();
|
|
|
|
|
|
-
|
|
|
lcd_puts_P(PSTR("Factory RESET"));
|
|
|
|
|
|
-
|
|
|
SET_OUTPUT(BEEPER);
|
|
|
- if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
- WRITE(BEEPER, HIGH);
|
|
|
+ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
+ WRITE(BEEPER, HIGH);
|
|
|
|
|
|
while (!READ(BTN_ENC));
|
|
|
|
|
|
WRITE(BEEPER, LOW);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
_delay_ms(2000);
|
|
|
|
|
|
char level = reset_menu();
|
|
|
factory_reset(level);
|
|
|
|
|
|
switch (level) {
|
|
|
- case 0: _delay_ms(0); break;
|
|
|
- case 1: _delay_ms(0); break;
|
|
|
- case 2: _delay_ms(0); break;
|
|
|
- case 3: _delay_ms(0); break;
|
|
|
+ case 0:
|
|
|
+ case 1:
|
|
|
+ case 2:
|
|
|
+ case 3:
|
|
|
+ case 4: _delay_ms(0); break;
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -3043,6 +3012,8 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
|
|
|
|
|
int l_feedmultiply = setup_for_endstop_move();
|
|
|
lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME));
|
|
|
+ raise_z_above(MESH_HOME_Z_SEARCH);
|
|
|
+ st_synchronize();
|
|
|
home_xy();
|
|
|
|
|
|
enable_endstops(false);
|
|
@@ -3799,31 +3770,90 @@ void process_commands()
|
|
|
float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
|
|
|
int8_t SilentMode;
|
|
|
#endif
|
|
|
-
|
|
|
-
|
|
|
- ---------------------------------------------------------------------------------
|
|
|
- ### M117 - Display Message <a href="https://reprap.org/wiki/G-code#M117:_Display_Message">M117: Display Message</a>
|
|
|
- This causes the given message to be shown in the status line on an attached LCD.
|
|
|
- It is processed early as to allow printing messages that contain G, M, N or T.
|
|
|
+
|
|
|
+
|
|
|
+ ---------------------------------------------------------------------------------
|
|
|
+ ### M117 - Display Message <a href="https://reprap.org/wiki/G-code#M117:_Display_Message">M117: Display Message</a>
|
|
|
+ This causes the given message to be shown in the status line on an attached LCD.
|
|
|
+ It is processed early as to allow printing messages that contain G, M, N or T.
|
|
|
+
|
|
|
+ ---------------------------------------------------------------------------------
|
|
|
+ ### Special internal commands
|
|
|
+ These are used by internal functions to process certain actions in the right order. Some of these are also usable by the user.
|
|
|
+ They are processed early as the commands are complex (strings).
|
|
|
+ These are only available on the MK3(S) as these require TMC2130 drivers:
|
|
|
+ - CRASH DETECTED
|
|
|
+ - CRASH RECOVER
|
|
|
+ - CRASH_CANCEL
|
|
|
+ - TMC_SET_WAVE
|
|
|
+ - TMC_SET_STEP
|
|
|
+ - TMC_SET_CHOP
|
|
|
+ */
|
|
|
+ if (code_seen_P(PSTR("M117")))
|
|
|
+ {
|
|
|
+ starpos = (strchr(strchr_pointer + 5, '*'));
|
|
|
+ if (starpos != NULL)
|
|
|
+ *(starpos) = '\0';
|
|
|
+ lcd_setstatus(strchr_pointer + 5);
|
|
|
+ custom_message_type = CustomMsg::MsgUpdate;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ### M0, M1 - Stop the printer <a href="https://reprap.org/wiki/G-code#M0:_Stop_or_Unconditional_stop">M0: Stop or Unconditional stop</a>
|
|
|
+ #### Usage
|
|
|
+
|
|
|
+ M0 [P<ms<] [S<sec>] [string]
|
|
|
+ M1 [P<ms>] [S<sec>] [string]
|
|
|
+
|
|
|
+ #### Parameters
|
|
|
|
|
|
- ---------------------------------------------------------------------------------
|
|
|
- ### Special internal commands
|
|
|
- These are used by internal functions to process certain actions in the right order. Some of these are also usable by the user.
|
|
|
- They are processed early as the commands are complex (strings).
|
|
|
- These are only available on the MK3(S) as these require TMC2130 drivers:
|
|
|
- - CRASH DETECTED
|
|
|
- - CRASH RECOVER
|
|
|
- - CRASH_CANCEL
|
|
|
- - TMC_SET_WAVE
|
|
|
- - TMC_SET_STEP
|
|
|
- - TMC_SET_CHOP
|
|
|
- */
|
|
|
- if (code_seen_P(PSTR("M117"))) {
|
|
|
- starpos = (strchr(strchr_pointer + 5, '*'));
|
|
|
- if (starpos != NULL)
|
|
|
- *(starpos) = '\0';
|
|
|
- lcd_setstatus(strchr_pointer + 5);
|
|
|
- }
|
|
|
+ - `P<ms>` - Expire time, in milliseconds
|
|
|
+ - `S<sec>` - Expire time, in seconds
|
|
|
+ - `string` - Must for M1 and optional for M0 message to display on the LCD
|
|
|
+ */
|
|
|
+
|
|
|
+ else if (code_seen_P(PSTR("M0")) || code_seen_P(PSTR("M1 "))) {
|
|
|
+ char *src = strchr_pointer + 2;
|
|
|
+ codenum = 0;
|
|
|
+ bool hasP = false, hasS = false;
|
|
|
+ if (code_seen('P')) {
|
|
|
+ codenum = code_value();
|
|
|
+ hasP = codenum > 0;
|
|
|
+ }
|
|
|
+ if (code_seen('S')) {
|
|
|
+ codenum = code_value() * 1000;
|
|
|
+ hasS = codenum > 0;
|
|
|
+ }
|
|
|
+ starpos = strchr(src, '*');
|
|
|
+ if (starpos != NULL) *(starpos) = '\0';
|
|
|
+ while (*src == ' ') ++src;
|
|
|
+ custom_message_type = CustomMsg::M0Wait;
|
|
|
+ if (!hasP && !hasS && *src != '\0') {
|
|
|
+ lcd_setstatus(src);
|
|
|
+ } else {
|
|
|
+ LCD_MESSAGERPGM(_i("Wait for user..."));
|
|
|
+ }
|
|
|
+ lcd_ignore_click();
|
|
|
+ st_synchronize();
|
|
|
+ previous_millis_cmd = _millis();
|
|
|
+ if (codenum > 0) {
|
|
|
+ codenum += _millis();
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
+ while(_millis() < codenum && !lcd_clicked()) {
|
|
|
+ manage_heater();
|
|
|
+ manage_inactivity(true);
|
|
|
+ lcd_update(0);
|
|
|
+ }
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
+ lcd_ignore_click(false);
|
|
|
+ } else {
|
|
|
+ marlin_wait_for_click();
|
|
|
+ }
|
|
|
+ if (IS_SD_PRINTING)
|
|
|
+ custom_message_type = CustomMsg::Status;
|
|
|
+ else
|
|
|
+ LCD_MESSAGERPGM(_T(WELCOME_MSG));
|
|
|
+ }
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("CRASH_"), 6) == 0)
|
|
@@ -4004,9 +4034,9 @@ void process_commands()
|
|
|
}else if (code_seen_P("fv")) {
|
|
|
|
|
|
#ifdef SDSUPPORT
|
|
|
- card.openFile(strchr_pointer + 3,true);
|
|
|
+ card.openFileReadFilteredGcode(strchr_pointer + 3,true);
|
|
|
while (true) {
|
|
|
- uint16_t readByte = card.get();
|
|
|
+ uint16_t readByte = card.getFilteredGcodeChar();
|
|
|
MYSERIAL.write(readByte);
|
|
|
if (readByte=='\n') {
|
|
|
break;
|
|
@@ -4019,7 +4049,7 @@ void process_commands()
|
|
|
} else if (code_seen_P(PSTR("M28"))) {
|
|
|
trace();
|
|
|
prusa_sd_card_upload = true;
|
|
|
- card.openFile(strchr_pointer+4,false);
|
|
|
+ card.openFileWrite(strchr_pointer+4);
|
|
|
|
|
|
} else if (code_seen_P(PSTR("SN"))) {
|
|
|
char SN[20];
|
|
@@ -5682,60 +5712,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
switch(mcode_in_progress)
|
|
|
{
|
|
|
|
|
|
-
|
|
|
- ### M0, M1 - Stop the printer <a href="https://reprap.org/wiki/G-code#M0:_Stop_or_Unconditional_stop">M0: Stop or Unconditional stop</a>
|
|
|
- */
|
|
|
- case 0:
|
|
|
- case 1:
|
|
|
- {
|
|
|
- char *src = strchr_pointer + 2;
|
|
|
-
|
|
|
- codenum = 0;
|
|
|
-
|
|
|
- bool hasP = false, hasS = false;
|
|
|
- if (code_seen('P')) {
|
|
|
- codenum = code_value();
|
|
|
- hasP = codenum > 0;
|
|
|
- }
|
|
|
- if (code_seen('S')) {
|
|
|
- codenum = code_value() * 1000;
|
|
|
- hasS = codenum > 0;
|
|
|
- }
|
|
|
- starpos = strchr(src, '*');
|
|
|
- if (starpos != NULL) *(starpos) = '\0';
|
|
|
- while (*src == ' ') ++src;
|
|
|
- if (!hasP && !hasS && *src != '\0') {
|
|
|
- lcd_setstatus(src);
|
|
|
- } else {
|
|
|
- LCD_MESSAGERPGM(_i("Wait for user..."));
|
|
|
- }
|
|
|
-
|
|
|
- lcd_ignore_click();
|
|
|
- st_synchronize();
|
|
|
- previous_millis_cmd = _millis();
|
|
|
- if (codenum > 0){
|
|
|
- codenum += _millis();
|
|
|
- KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
- while(_millis() < codenum && !lcd_clicked()){
|
|
|
- manage_heater();
|
|
|
- manage_inactivity(true);
|
|
|
- lcd_update(0);
|
|
|
- }
|
|
|
- KEEPALIVE_STATE(IN_HANDLER);
|
|
|
- lcd_ignore_click(false);
|
|
|
- }else{
|
|
|
- marlin_wait_for_click();
|
|
|
- }
|
|
|
- if (IS_SD_PRINTING)
|
|
|
- LCD_MESSAGERPGM(_T(MSG_RESUMING_PRINT));
|
|
|
- else
|
|
|
- LCD_MESSAGERPGM(_T(WELCOME_MSG));
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
|
|
|
### M17 - Enable all axes <a href="https://reprap.org/wiki/G-code#M17:_Enable.2FPower_all_stepper_motors">M17: Enable/Power all stepper motors</a>
|
|
|
*/
|
|
|
+
|
|
|
case 17:
|
|
|
LCD_MESSAGERPGM(_i("No move."));
|
|
|
enable_x();
|
|
@@ -5788,7 +5768,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
starpos = (strchr(strchr_pointer + 4,'*'));
|
|
|
if(starpos!=NULL)
|
|
|
*(starpos)='\0';
|
|
|
- card.openFile(strchr_pointer + 4,true);
|
|
|
+ card.openFileReadFilteredGcode(strchr_pointer + 4);
|
|
|
break;
|
|
|
|
|
|
|
|
@@ -5858,7 +5838,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
strchr_pointer = strchr(npos,' ') + 1;
|
|
|
*(starpos) = '\0';
|
|
|
}
|
|
|
- card.openFile(strchr_pointer+4,false);
|
|
|
+ card.openFileWrite(strchr_pointer+4);
|
|
|
break;
|
|
|
|
|
|
|
|
@@ -5919,7 +5899,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
|
|
|
if( card.cardOK )
|
|
|
{
|
|
|
- card.openFile(namestartpos,true,!call_procedure);
|
|
|
+ card.openFileReadFilteredGcode(namestartpos,!call_procedure);
|
|
|
if(code_seen('S'))
|
|
|
if(strchr_pointer<namestartpos)
|
|
|
card.setIndex(code_value_long());
|
|
@@ -6393,31 +6373,37 @@ Sigma_Exit:
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
- ### M73 - Set/get print progress <a href="https://reprap.org/wiki/G-code#M73:_Set.2FGet_build_percentage">M73: Set/Get build percentage</a>
|
|
|
- #### Usage
|
|
|
-
|
|
|
- M73 [ P | R | Q | S ]
|
|
|
+
|
|
|
+ ### M73 - Set/get print progress <a href="https://reprap.org/wiki/G-code#M73:_Set.2FGet_build_percentage">M73: Set/Get build percentage</a>
|
|
|
+ #### Usage
|
|
|
|
|
|
- #### Parameters
|
|
|
- - `P` - Percent in normal mode
|
|
|
- - `R` - Time remaining in normal mode
|
|
|
- - `Q` - Percent in silent mode
|
|
|
- - `S` - Time in silent mode
|
|
|
- */
|
|
|
- case 73:
|
|
|
- if(code_seen('P')) print_percent_done_normal = code_value();
|
|
|
- if(code_seen('R')) print_time_remaining_normal = code_value();
|
|
|
- if(code_seen('Q')) print_percent_done_silent = code_value();
|
|
|
- if(code_seen('S')) print_time_remaining_silent = code_value();
|
|
|
+ M73 [ P | R | Q | S | C | D ]
|
|
|
|
|
|
- {
|
|
|
- const char* _msg_mode_done_remain = _N("%S MODE: Percent done: %d; print time remaining in mins: %d\n");
|
|
|
- printf_P(_msg_mode_done_remain, _N("NORMAL"), int(print_percent_done_normal), print_time_remaining_normal);
|
|
|
- printf_P(_msg_mode_done_remain, _N("SILENT"), int(print_percent_done_silent), print_time_remaining_silent);
|
|
|
- }
|
|
|
- break;
|
|
|
+ #### Parameters
|
|
|
+ - `P` - Percent in normal mode
|
|
|
+ - `R` - Time remaining in normal mode
|
|
|
+ - `Q` - Percent in silent mode
|
|
|
+ - `S` - Time in silent mode
|
|
|
+ - `C` - Time to change/pause/user interaction in normal mode
|
|
|
+ - `D` - Time to change/pause/user interaction in silent mode
|
|
|
+ */
|
|
|
+
|
|
|
+ case 73:
|
|
|
+ {
|
|
|
+ if(code_seen('P')) print_percent_done_normal = code_value();
|
|
|
+ if(code_seen('R')) print_time_remaining_normal = code_value();
|
|
|
+ if(code_seen('Q')) print_percent_done_silent = code_value();
|
|
|
+ if(code_seen('S')) print_time_remaining_silent = code_value();
|
|
|
+ if(code_seen('C')) print_time_to_change_normal = code_value();
|
|
|
+ if(code_seen('D')) print_time_to_change_silent = code_value();
|
|
|
|
|
|
+ {
|
|
|
+ const char* _msg_mode_done_remain = _N("%S MODE: Percent done: %d; print time remaining in mins: %d; Change in mins: %d\n");
|
|
|
+ printf_P(_msg_mode_done_remain, _N("NORMAL"), int(print_percent_done_normal), print_time_remaining_normal, print_time_to_change_normal);
|
|
|
+ printf_P(_msg_mode_done_remain, _N("SILENT"), int(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
### M104 - Set hotend temperature <a href="https://reprap.org/wiki/G-code#M104:_Set_Extruder_Temperature">M104: Set Extruder Temperature</a>
|
|
|
#### Usage
|
|
@@ -6990,14 +6976,14 @@ Sigma_Exit:
|
|
|
### M120 - Enable endstops <a href="https://reprap.org/wiki/G-code#M120:_Enable_endstop_detection">M120: Enable endstop detection</a>
|
|
|
*/
|
|
|
case 120:
|
|
|
- enable_endstops(false) ;
|
|
|
+ enable_endstops(true) ;
|
|
|
break;
|
|
|
|
|
|
|
|
|
### M121 - Disable endstops <a href="https://reprap.org/wiki/G-code#M121:_Disable_endstop_detection">M121: Disable endstop detection</a>
|
|
|
*/
|
|
|
case 121:
|
|
|
- enable_endstops(true) ;
|
|
|
+ enable_endstops(false) ;
|
|
|
break;
|
|
|
|
|
|
|
|
@@ -7258,7 +7244,7 @@ Sigma_Exit:
|
|
|
|
|
|
|
|
|
|
|
|
- cs.acceleration = code_value();
|
|
|
+ cs.acceleration = cs.travel_acceleration = code_value();
|
|
|
|
|
|
if(code_seen('T'))
|
|
|
cs.retract_acceleration = code_value();
|
|
@@ -7268,13 +7254,8 @@ Sigma_Exit:
|
|
|
cs.acceleration = code_value();
|
|
|
if(code_seen('R'))
|
|
|
cs.retract_acceleration = code_value();
|
|
|
- if(code_seen('T')) {
|
|
|
-
|
|
|
-
|
|
|
- @todo Prusa3D firmware currently does not support travel acceleration value independent from the extruding acceleration value.
|
|
|
- */
|
|
|
-
|
|
|
- }
|
|
|
+ if(code_seen('T'))
|
|
|
+ cs.travel_acceleration = code_value();
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -8141,8 +8122,7 @@ Sigma_Exit:
|
|
|
case 25:
|
|
|
case 601:
|
|
|
{
|
|
|
- if (!isPrintPaused)
|
|
|
- {
|
|
|
+ if (!isPrintPaused) {
|
|
|
st_synchronize();
|
|
|
ClearToSend();
|
|
|
cmdqueue_pop_front();
|
|
@@ -8156,8 +8136,7 @@ Sigma_Exit:
|
|
|
*/
|
|
|
case 602:
|
|
|
{
|
|
|
- if (isPrintPaused)
|
|
|
- {
|
|
|
+ if (isPrintPaused) {
|
|
|
#ifdef FANCHECK
|
|
|
if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK))
|
|
|
lcd_resume_print();
|
|
@@ -10976,6 +10955,10 @@ void uvlo_()
|
|
|
#endif
|
|
|
eeprom_update_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY), (uint16_t)extrudemultiply);
|
|
|
|
|
|
+ eeprom_update_float((float*)(EEPROM_UVLO_ACCELL), cs.acceleration);
|
|
|
+ eeprom_update_float((float*)(EEPROM_UVLO_RETRACT_ACCELL), cs.retract_acceleration);
|
|
|
+ eeprom_update_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL), cs.travel_acceleration);
|
|
|
+
|
|
|
|
|
|
eeprom_update_float((float*)(EEPROM_UVLO_SAVED_TARGET+0*4), saved_target[X_AXIS]);
|
|
|
eeprom_update_float((float*)(EEPROM_UVLO_SAVED_TARGET+1*4), saved_target[Y_AXIS]);
|
|
@@ -11288,8 +11271,8 @@ void restore_print_from_eeprom(bool mbl_was_active) {
|
|
|
}
|
|
|
dir_name[8] = '\0';
|
|
|
MYSERIAL.println(dir_name);
|
|
|
- strcpy(dir_names[i], dir_name);
|
|
|
- card.chdir(dir_name);
|
|
|
+
|
|
|
+ card.chdir(dir_name, false);
|
|
|
}
|
|
|
|
|
|
for (int i = 0; i < 8; i++) {
|
|
@@ -11320,6 +11303,13 @@ void restore_print_from_eeprom(bool mbl_was_active) {
|
|
|
sprintf_P(cmd, PSTR("G1 Z%f"), eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_Z)));
|
|
|
enquecommand(cmd);
|
|
|
|
|
|
+
|
|
|
+ float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL));
|
|
|
+ float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL));
|
|
|
+ float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL));
|
|
|
+ sprintf_P(cmd, PSTR("M204 P%f R%f T%f"), acceleration, retract_acceleration, travel_acceleration);
|
|
|
+ enquecommand(cmd);
|
|
|
+
|
|
|
|
|
|
sprintf_P(cmd, PSTR("G1 E%0.3f F2700"), default_retraction);
|
|
|
enquecommand(cmd);
|
|
@@ -11657,46 +11647,40 @@ void print_mesh_bed_leveling_table()
|
|
|
SERIAL_ECHOLN();
|
|
|
}
|
|
|
|
|
|
-uint16_t print_time_remaining() {
|
|
|
- uint16_t print_t = PRINT_TIME_REMAINING_INIT;
|
|
|
-#ifdef TMC2130
|
|
|
- if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_remaining_normal;
|
|
|
- else print_t = print_time_remaining_silent;
|
|
|
-#else
|
|
|
- print_t = print_time_remaining_normal;
|
|
|
-#endif
|
|
|
- if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply;
|
|
|
- return print_t;
|
|
|
-}
|
|
|
-
|
|
|
uint8_t calc_percent_done()
|
|
|
{
|
|
|
-
|
|
|
- uint8_t percent_done = 0;
|
|
|
+
|
|
|
+ uint8_t percent_done = 0;
|
|
|
#ifdef TMC2130
|
|
|
- if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) {
|
|
|
- percent_done = print_percent_done_normal;
|
|
|
- }
|
|
|
- else if (print_percent_done_silent <= 100) {
|
|
|
- percent_done = print_percent_done_silent;
|
|
|
- }
|
|
|
+ if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100)
|
|
|
+ {
|
|
|
+ percent_done = print_percent_done_normal;
|
|
|
+ }
|
|
|
+ else if (print_percent_done_silent <= 100)
|
|
|
+ {
|
|
|
+ percent_done = print_percent_done_silent;
|
|
|
+ }
|
|
|
#else
|
|
|
- if (print_percent_done_normal <= 100) {
|
|
|
- percent_done = print_percent_done_normal;
|
|
|
- }
|
|
|
+ if (print_percent_done_normal <= 100)
|
|
|
+ {
|
|
|
+ percent_done = print_percent_done_normal;
|
|
|
+ }
|
|
|
#endif
|
|
|
- else {
|
|
|
- percent_done = card.percentDone();
|
|
|
- }
|
|
|
- return percent_done;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ percent_done = card.percentDone();
|
|
|
+ }
|
|
|
+ return percent_done;
|
|
|
}
|
|
|
|
|
|
static void print_time_remaining_init()
|
|
|
{
|
|
|
- print_time_remaining_normal = PRINT_TIME_REMAINING_INIT;
|
|
|
- print_time_remaining_silent = PRINT_TIME_REMAINING_INIT;
|
|
|
- print_percent_done_normal = PRINT_PERCENT_DONE_INIT;
|
|
|
- print_percent_done_silent = PRINT_PERCENT_DONE_INIT;
|
|
|
+ print_time_remaining_normal = PRINT_TIME_REMAINING_INIT;
|
|
|
+ print_percent_done_normal = PRINT_PERCENT_DONE_INIT;
|
|
|
+ print_time_remaining_silent = PRINT_TIME_REMAINING_INIT;
|
|
|
+ print_percent_done_silent = PRINT_PERCENT_DONE_INIT;
|
|
|
+ print_time_to_change_normal = PRINT_TIME_REMAINING_INIT;
|
|
|
+ print_time_to_change_silent = PRINT_TIME_REMAINING_INIT;
|
|
|
}
|
|
|
|
|
|
void load_filament_final_feed()
|
|
@@ -11786,7 +11770,7 @@ void M600_wait_for_user(float HotendTempBckp) {
|
|
|
delay_keep_alive(4);
|
|
|
|
|
|
if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) {
|
|
|
- lcd_display_message_fullscreen_P(_i("Press knob to preheat nozzle and continue."));
|
|
|
+ lcd_display_message_fullscreen_P(_i("Press the knob to preheat nozzle and continue."));
|
|
|
wait_for_user_state = 1;
|
|
|
setAllTargetHotends(0);
|
|
|
st_synchronize();
|